#include "texture.h"
#include "log/log.h"

#include <renderer.h>
#include <opengl.h>
#include <glcontext.h>

#include <os/generatemipmaps30.h>

#include <pipeline/pipeline.h>

#include <resource/physicalfile.h>

#include <util/fs.h>
#include <util/deletetexturetask.h>

#include <3rdparty/picojson/valuetotype.h>

#include <errno.h>

static const unsigned char texdata[16384]=
{
255, 34, 33, 223, 255, 33, 34, 223, 255, 33, 33, 223, 254, 34, 34, 223, 251, 33, 37, 223, 246, 34, 41, 223, 239, 33, 48, 223, 229, 34, 56, 223, 212, 34, 71, 223, 194, 33, 87, 223, 177, 33, 102, 223, 164, 34, 114, 223, 161, 34, 117, 223, 168, 34, 110, 223, 184, 33, 96, 223, 206, 34, 76, 223, 223, 33, 62, 223, 231, 34, 56, 223, 236, 34, 51, 223, 238, 33, 48, 223, 242, 33, 44, 223, 245, 33, 42, 223, 248, 33, 40, 223, 249, 33, 39, 223, 249, 33, 39, 223, 249, 33, 39, 223, 247, 33, 42, 223, 245, 33, 41, 223, 243, 33, 43, 223, 242, 33, 45, 223, 239, 33, 47, 223, 237, 33, 50, 223, 232, 33, 54, 223, 224, 33, 61, 223, 212, 33, 71, 223, 192, 33, 89, 223, 174, 33, 105, 223, 155, 34, 121, 223, 141, 34, 134, 223, 136, 34, 139, 223, 137, 34, 138, 223, 154, 34, 122, 223, 180, 33, 100, 223, 208, 33, 75, 223, 234, 33, 52, 223, 247, 33, 40, 223, 253, 33, 34, 223, 255, 32, 33, 223, 255, 33, 33, 223, 255, 33, 33, 223, 255, 32, 33, 223, 255, 33, 33, 223, 255, 33, 33, 223, 255, 33, 33, 223, 255, 33, 33, 223, 255, 33, 33, 223, 255, 33, 33, 223, 255, 32, 33, 223, 255, 32, 33, 223, 255, 33, 32, 223, 255, 32, 32, 223, 255, 33, 33, 223, 255, 33, 32, 223, 255, 33, 33, 223, 255, 37, 37, 223, 255, 37, 37, 223, 255, 37, 38, 223, 252, 37, 40, 223, 246, 38, 46, 223, 237, 38, 54, 223, 223, 37, 64, 223, 208, 37, 78, 223, 186, 37, 98, 223, 165, 36, 115, 223, 148, 36, 131, 223, 136, 36, 141, 223, 137, 36, 139, 223, 147, 36, 131, 223, 165, 36, 115, 223, 186, 37, 98, 223, 201, 37, 83, 223, 209, 37, 77, 223, 216, 37, 71, 223, 222, 37, 66, 223, 228, 37, 61, 223, 233, 37, 55, 223, 238, 37, 51, 223, 240, 37, 50, 223, 241, 37, 49, 223, 241, 37, 49, 223, 241, 37, 49, 223, 241, 37, 48, 223, 241, 37, 49, 223, 239, 37, 51, 223, 236, 37, 53, 223, 230, 37, 58, 223, 223, 37, 66, 223, 207, 37, 79, 223, 189, 37, 93, 223, 166, 36, 115, 223, 144, 36, 133, 223, 126, 36, 149, 223, 115, 36, 159, 223, 116, 36, 158, 223, 126, 36, 150, 223, 148, 36, 130, 223, 178, 37, 104, 223, 210, 36, 77, 223, 238, 36, 51, 223, 251, 37, 40, 223, 255, 37, 37, 223, 255, 37, 37, 223, 255, 37, 37, 223, 255, 37, 36, 223, 255, 36, 37, 223, 255, 36, 36, 223, 255, 36, 37, 223, 255, 37, 37, 223, 255, 36, 37, 223, 255, 36, 36, 223, 255, 37, 37, 223, 255, 36, 36, 223, 255, 37, 37, 223, 255, 36, 37, 223, 255, 37, 37, 223, 255, 36, 36, 223, 255, 37, 36, 223, 255, 36, 36, 223, 255, 41, 41, 223, 254, 41, 42, 223, 250, 41, 45, 223, 243, 41, 51, 223, 231, 41, 61, 223, 216, 40, 75, 223, 196, 39, 90, 223, 177, 39, 107, 223, 156, 38, 125, 223, 138, 38, 140, 223, 125, 38, 151, 223, 119, 37, 157, 223, 123, 37, 153, 223, 136, 38, 142, 223, 154, 38, 127, 223, 173, 39, 111, 223, 188, 39, 98, 223, 198, 39, 89, 223, 207, 39, 83, 223, 213, 39, 77, 223, 219, 40, 71, 223, 226, 40, 66, 223, 230, 41, 61, 223, 232, 41, 61, 223, 233, 41, 59, 223, 233, 41, 60, 223, 233, 40, 59, 223, 234, 40, 59, 223, 234, 40, 59, 223, 232, 41, 60, 223, 226, 41, 65, 223, 214, 40, 76, 223, 199, 39, 89, 223, 179, 39, 105, 223, 159, 38, 123, 223, 137, 38, 142, 223, 118, 37, 158, 223, 106, 37, 167, 223, 101, 37, 172, 223, 108, 37, 166, 223, 122, 37, 153, 223, 148, 38, 132, 223, 181, 38, 104, 223, 213, 39, 76, 223, 238, 40, 55, 223, 248, 41, 47, 223, 249, 40, 46, 223, 247, 40, 46, 223, 245, 40, 48, 223, 243, 40, 50, 223, 244, 41, 50, 223, 245, 40, 48, 223, 246, 40, 47, 223, 247, 41, 47, 223, 247, 40, 46, 223, 247, 41, 47, 223, 247, 41, 46, 223, 245, 40, 48, 223, 245, 40, 49, 223, 246, 40, 47, 223, 250, 40, 45, 223, 251, 40, 43, 223, 254, 40, 42, 223, 255, 40, 40, 223, 255, 45, 44, 223, 252, 45, 48, 223, 245, 45, 53, 223, 233, 44, 62, 223, 215, 42, 78, 223, 194, 42, 96, 223, 171, 41, 115, 223, 150, 40, 132, 223, 130, 39, 149, 223, 115, 39, 161, 223, 107, 38, 168, 223, 105, 38, 170, 223, 112, 38, 164, 223, 126, 39, 152, 223, 143, 40, 138, 223, 161, 41, 122, 223, 176, 41, 110, 223, 187, 41, 101, 223, 197, 42, 92, 223, 207, 43, 84, 223, 213, 42, 81, 223, 217, 42, 76, 223, 221, 43, 72, 223, 223, 42, 71, 223, 226, 42, 69, 223, 226, 43, 69, 223, 227, 42, 67, 223, 229, 42, 66, 223, 229, 43, 66, 223, 225, 42, 69, 223, 214, 42, 79, 223, 195, 42, 94, 223, 175, 41, 111, 223, 151, 39, 131, 223, 129, 38, 150, 223, 110, 38, 165, 223, 96, 37, 177, 223, 90, 37, 182, 223, 89, 37, 182, 223, 101, 37, 173, 223, 120, 38, 156, 223, 149, 40, 133, 223, 182, 41, 106, 223, 214, 43, 79, 223, 239, 44, 58, 223, 244, 44, 53, 223, 241, 44, 56, 223, 236, 44, 60, 223, 233, 44, 62, 223, 232, 43, 64, 223, 232, 43, 63, 223, 233, 44, 62, 223, 235, 44, 60, 223, 236, 44, 60, 223, 237, 44, 60, 223, 237, 44, 58, 223, 236, 44, 60, 223, 236, 44, 60, 223, 235, 44, 60, 223, 237, 44, 59, 223, 241, 44, 56, 223, 245, 44, 52, 223, 251, 44, 48, 223, 254, 44, 45, 223, 250, 49, 53, 223, 244, 49, 58, 223, 231, 46, 68, 223, 214, 46, 82, 223, 190, 44, 101, 223, 166, 43, 121, 223, 144, 41, 139, 223, 125, 40, 154, 223, 112, 39, 165, 223, 103, 39, 172, 223, 102, 39, 173, 223, 106, 39, 170, 223, 116, 39, 161, 223, 132, 41, 149, 223, 148, 41, 135, 223, 163, 43, 123, 223, 177, 43, 112, 223, 187, 44, 103, 223, 196, 44, 96, 223, 201, 44, 92, 223, 206, 45, 89, 223, 210, 46, 85, 223, 214, 46, 82, 223, 216, 46, 80, 223, 218, 46, 79, 223, 218, 46, 78, 223, 218, 46, 77, 223, 219, 47, 78, 223, 216, 46, 81, 223, 206, 45, 88, 223, 192, 44, 100, 223, 169, 43, 118, 223, 148, 41, 135, 223, 126, 40, 153, 223, 108, 39, 168, 223, 95, 38, 179, 223, 85, 37, 187, 223, 83, 37, 189, 223, 84, 37, 188, 223, 96, 38, 177, 223, 116, 39, 161, 223, 143, 41, 140, 223, 172, 43, 115, 223, 200, 45, 92, 223, 223, 46, 74, 223, 230, 46, 69, 223, 227, 46, 70, 223, 223, 46, 74, 223, 221, 46, 76, 223, 219, 46, 77, 223, 220, 46, 77, 223, 222, 46, 75, 223, 225, 46, 73, 223, 226, 46, 72, 223, 226, 46, 73, 223, 225, 46, 73, 223, 222, 46, 75, 223, 223, 46, 74, 223, 226, 45, 72, 223, 230, 46, 69, 223, 236, 46, 64, 223, 243, 48, 58, 223, 249, 48, 51, 223, 254, 48, 49, 223, 246, 52, 60, 223, 237, 51, 67, 223, 217, 49, 83, 223, 195, 47, 99, 223, 165, 44, 124, 223, 139, 43, 145, 223, 119, 41, 160, 223, 105, 40, 172, 223, 97, 39, 178, 223, 95, 39, 180, 223, 100, 39, 176, 223, 109, 40, 168, 223, 125, 41, 156, 223, 141, 43, 143, 223, 156, 44, 131, 223, 171, 45, 119, 223, 182, 46, 110, 223, 190, 47, 103, 223, 195, 48, 100, 223, 197, 47, 98, 223, 200, 48, 96, 223, 202, 48, 94, 223, 206, 48, 92, 223, 209, 48, 89, 223, 209, 48, 88, 223, 209, 48, 88, 223, 210, 48, 88, 223, 207, 48, 91, 223, 200, 47, 95, 223, 186, 47, 107, 223, 168, 45, 121, 223, 145, 43, 140, 223, 123, 41, 157, 223, 106, 40, 171, 223, 92, 38, 182, 223, 83, 38, 189, 223, 77, 37, 194, 223, 77, 37, 194, 223, 81, 38, 191, 223, 93, 39, 181, 223, 111, 40, 167, 223, 134, 42, 148, 223, 160, 44, 128, 223, 185, 46, 108, 223, 205, 48, 92, 223, 211, 47, 86, 223, 210, 48, 88, 223, 209, 48, 88, 223, 209, 47, 88, 223, 208, 48, 90, 223, 209, 47, 89, 223, 210, 48, 87, 223, 214, 48, 84, 223, 215, 48, 83, 223, 215, 48, 84, 223, 213, 48, 85, 223, 210, 47, 88, 223, 210, 48, 87, 223, 216, 48, 83, 223, 223, 49, 76, 223, 233, 49, 70, 223, 242, 50, 61, 223, 249, 51, 56, 223, 254, 51, 52, 223, 236, 54, 70, 223, 220, 53, 84, 223, 196, 50, 103, 223, 170, 48, 122, 223, 144, 45, 143, 223, 122, 42, 159, 223, 109, 41, 169, 223, 101, 40, 176, 223, 98, 40, 177, 223, 101, 40, 176, 223, 110, 41, 168, 223, 124, 43, 158, 223, 139, 44, 146, 223, 155, 46, 133, 223, 169, 47, 123, 223, 178, 48, 116, 223, 187, 49, 109, 223, 194, 50, 103, 223, 197, 50, 101, 223, 199, 50, 100, 223, 199, 50, 99, 223, 200, 50, 99, 223, 202, 50, 98, 223, 203, 51, 96, 223, 203, 51, 97, 223, 200, 50, 98, 223, 196, 50, 102, 223, 189, 49, 108, 223, 177, 47, 117, 223, 159, 46, 130, 223, 141, 45, 145, 223, 122, 42, 160, 223, 106, 41, 172, 223, 93, 39, 182, 223, 84, 38, 189, 223, 79, 38, 193, 223, 76, 38, 195, 223, 78, 38, 194, 223, 83, 39, 190, 223, 95, 40, 180, 223, 112, 41, 168, 223, 133, 43, 150, 223, 156, 45, 133, 223, 178, 48, 116, 223, 197, 49, 101, 223, 202, 50, 96, 223, 203, 51, 96, 223, 203, 51, 96, 223, 202, 51, 96, 223, 201, 50, 98, 223, 199, 50, 99, 223, 200, 50, 99, 223, 202, 51, 96, 223, 203, 51, 96, 223, 203, 51, 96, 223, 203, 50, 96, 223, 205, 51, 95, 223, 209, 52, 92, 223, 219, 51, 83, 223, 228, 54, 76, 223, 238, 54, 70, 223, 246, 54, 63, 223, 251, 55, 59, 223, 254, 55, 56, 223, 225, 57, 82, 223, 204, 54, 98, 223, 173, 50, 122, 223, 146, 47, 142, 223, 126, 45, 158, 223, 110, 42, 170, 223, 104, 42, 175, 223, 101, 42, 177, 223, 105, 42, 174, 223, 112, 43, 168, 223, 126, 44, 157, 223, 144, 47, 145, 223, 159, 49, 133, 223, 173, 50, 122, 223, 182, 50, 115, 223, 187, 51, 111, 223, 193, 52, 107, 223, 198, 53, 103, 223, 201, 53, 100, 223, 199, 53, 102, 223, 199, 53, 102, 223, 198, 53, 103, 223, 199, 53, 103, 223, 199, 53, 102, 223, 198, 53, 102, 223, 191, 52, 109, 223, 180, 51, 116, 223, 166, 49, 127, 223, 150, 47, 139, 223, 132, 45, 153, 223, 116, 43, 165, 223, 101, 41, 177, 223, 90, 40, 185, 223, 84, 39, 189, 223, 80, 39, 193, 223, 77, 38, 195, 223, 76, 38, 195, 223, 80, 39, 192, 223, 87, 40, 187, 223, 99, 41, 178, 223, 115, 43, 166, 223, 134, 45, 152, 223, 154, 48, 136, 223, 174, 49, 121, 223, 190, 51, 109, 223, 198, 53, 103, 223, 199, 53, 102, 223, 199, 53, 102, 223, 197, 52, 104, 223, 195, 52, 105, 223, 192, 53, 108, 223, 189, 52, 109, 223, 190, 52, 109, 223, 192, 52, 107, 223, 195, 52, 105, 223, 198, 53, 103, 223, 202, 53, 99, 223, 211, 54, 94, 223, 224, 55, 83, 223, 235, 58, 74, 223, 246, 58, 66, 223, 252, 59, 62, 223, 254, 59, 60, 223, 255, 60, 59, 223, 214, 58, 94, 223, 188, 54, 114, 223, 158, 50, 135, 223, 135, 47, 152, 223, 121, 45, 163, 223, 112, 44, 170, 223, 110, 44, 171, 223, 112, 44, 170, 223, 119, 45, 164, 223, 130, 47, 156, 223, 145, 48, 145, 223, 162, 50, 133, 223, 174, 53, 124, 223, 184, 54, 116, 223, 190, 55, 112, 223, 194, 55, 108, 223, 197, 55, 106, 223, 200, 56, 104, 223, 201, 56, 104, 223, 199, 56, 104, 223, 197, 56, 106, 223, 196, 55, 108, 223, 194, 55, 110, 223, 192, 55, 111, 223, 186, 54, 114, 223, 176, 53, 123, 223, 161, 50, 134, 223, 145, 48, 144, 223, 129, 47, 157, 223, 112, 44, 169, 223, 99, 42, 179, 223, 90, 41, 186, 223, 83, 40, 191, 223, 81, 39, 193, 223, 79, 39, 194, 223, 79, 39, 194, 223, 81, 40, 192, 223, 88, 41, 187, 223, 97, 42, 181, 223, 109, 43, 172, 223, 124, 46, 160, 223, 141, 47, 148, 223, 159, 50, 134, 223, 175, 52, 124, 223, 187, 54, 114, 223, 193, 55, 110, 223, 194, 55, 109, 223, 194, 55, 109, 223, 193, 54, 109, 223, 189, 54, 112, 223, 184, 54, 116, 223, 181, 53, 117, 223, 182, 53, 117, 223, 185, 54, 115, 223, 187, 54, 113, 223, 193, 55, 109, 223, 203, 56, 102, 223, 215, 58, 93, 223, 230, 60, 81, 223, 242, 61, 73, 223, 249, 62, 67, 223, 253, 63, 64, 223, 255, 63, 63, 223, 255, 63, 63, 223, 203, 60, 106, 223, 173, 55, 127, 223, 146, 51, 146, 223, 127, 47, 160, 223, 121, 46, 165, 223, 119, 46, 166, 223, 123, 46, 163, 223, 129, 48, 158, 223, 140, 49, 151, 223, 153, 51, 141, 223, 167, 54, 131, 223, 179, 55, 122, 223, 188, 57, 115, 223, 194, 58, 112, 223, 196, 59, 109, 223, 197, 59, 109, 223, 199, 59, 108, 223, 199, 58, 108, 223, 199, 58, 108, 223, 197, 58, 109, 223, 195, 58, 111, 223, 192, 58, 113, 223, 189, 57, 115, 223, 183, 56, 119, 223, 173, 54, 126, 223, 159, 52, 138, 223, 142, 50, 149, 223, 124, 47, 161, 223, 109, 45, 173, 223, 97, 43, 182, 223, 88, 41, 188, 223, 82, 40, 192, 223, 79, 40, 194, 223, 79, 40, 194, 223, 81, 40, 193, 223, 84, 41, 191, 223, 90, 42, 187, 223, 99, 43, 180, 223, 110, 45, 172, 223, 123, 47, 162, 223, 137, 49, 153, 223, 151, 51, 142, 223, 165, 53, 132, 223, 177, 55, 124, 223, 185, 56, 117, 223, 187, 56, 115, 223, 188, 56, 115, 223, 188, 56, 115, 223, 188, 56, 116, 223, 184, 56, 118, 223, 179, 55, 121, 223, 176, 55, 124, 223, 174, 55, 125, 223, 178, 55, 123, 223, 183, 56, 119, 223, 192, 57, 112, 223, 204, 59, 104, 223, 219, 61, 93, 223, 236, 63, 81, 223, 249, 66, 71, 223, 254, 67, 68, 223, 255, 66, 66, 223, 255, 66, 67, 223, 255, 67, 67, 223, 193, 61, 115, 223, 163, 55, 137, 223, 142, 51, 151, 223, 128, 49, 161, 223, 127, 49, 161, 223, 132, 50, 158, 223, 140, 51, 153, 223, 148, 53, 147, 223, 160, 54, 138, 223, 171, 56, 130, 223, 182, 58, 123, 223, 190, 60, 117, 223, 195, 60, 113, 223, 199, 61, 111, 223, 199, 62, 110, 223, 199, 62, 110, 223, 198, 61, 111, 223, 198, 61, 111, 223, 196, 60, 112, 223, 196, 60, 113, 223, 193, 60, 115, 223, 189, 60, 117, 223, 181, 59, 123, 223, 170, 56, 131, 223, 156, 54, 141, 223, 140, 51, 152, 223, 124, 48, 164, 223, 110, 46, 174, 223, 98, 44, 182, 223, 90, 42, 187, 223, 84, 41, 192, 223, 81, 41, 194, 223, 81, 40, 194, 223, 84, 41, 192, 223, 89, 42, 188, 223, 96, 43, 183, 223, 105, 45, 177, 223, 116, 47, 169, 223, 128, 49, 160, 223, 141, 51, 152, 223, 153, 52, 143, 223, 163, 54, 136, 223, 172, 56, 129, 223, 180, 58, 124, 223, 185, 58, 120, 223, 186, 59, 120, 223, 184, 59, 120, 223, 184, 59, 120, 223, 182, 58, 122, 223, 178, 57, 125, 223, 172, 57, 129, 223, 168, 56, 131, 223, 167, 55, 133, 223, 170, 56, 131, 223, 175, 57, 127, 223, 184, 59, 121, 223, 196, 60, 112, 223, 212, 64, 101, 223, 230, 65, 87, 223, 245, 69, 78, 223, 250, 69, 74, 223, 252, 70, 72, 223, 254, 70, 72, 223, 255, 71, 71, 223, 183, 61, 125, 223, 154, 56, 145, 223, 140, 53, 155, 223, 134, 52, 158, 223, 140, 53, 154, 223, 151, 55, 147, 223, 160, 57, 140, 223, 171, 58, 133, 223, 179, 60, 127, 223, 186, 62, 122, 223, 192, 63, 119, 223, 195, 63, 116, 223, 199, 64, 114, 223, 201, 64, 112, 223, 201, 64, 112, 223, 199, 63, 114, 223, 197, 64, 115, 223, 196, 64, 116, 223, 194, 64, 116, 223, 193, 63, 117, 223, 189, 62, 120, 223, 183, 61, 124, 223, 171, 59, 133, 223, 154, 56, 144, 223, 138, 52, 155, 223, 121, 49, 167, 223, 108, 46, 176, 223, 98, 45, 183, 223, 91, 43, 187, 223, 87, 42, 190, 223, 84, 42, 192, 223, 83, 42, 193, 223, 85, 42, 191, 223, 93, 44, 186, 223, 102, 45, 179, 223, 113, 47, 172, 223, 126, 50, 163, 223, 139, 52, 154, 223, 151, 55, 146, 223, 160, 57, 139, 223, 169, 58, 134, 223, 175, 59, 130, 223, 180, 60, 126, 223, 183, 61, 124, 223, 184, 61, 123, 223, 183, 61, 123, 223, 181, 60, 125, 223, 179, 60, 127, 223, 176, 59, 129, 223, 172, 59, 131, 223, 166, 58, 136, 223, 162, 57, 139, 223, 159, 56, 141, 223, 160, 57, 139, 223, 164, 57, 138, 223, 172, 59, 132, 223, 183, 60, 125, 223, 198, 63, 114, 223, 217, 67, 100, 223, 231, 70, 90, 223, 239, 71, 85, 223, 245, 72, 81, 223, 251, 73, 77, 223, 254, 74, 75, 223, 184, 64, 126, 223, 156, 58, 145, 223, 148, 56, 150, 223, 148, 56, 150, 223, 157, 58, 145, 223, 168, 60, 137, 223, 178, 62, 130, 223, 185, 63, 125, 223, 192, 65, 121, 223, 196, 66, 118, 223, 199, 67, 116, 223, 200, 67, 115, 223, 202, 68, 114, 223, 202, 67, 114, 223, 201, 67, 115, 223, 198, 67, 116, 223, 196, 66, 118, 223, 193, 65, 120, 223, 191, 66, 121, 223, 189, 65, 123, 223, 183, 64, 127, 223, 172, 61, 135, 223, 155, 58, 145, 223, 138, 53, 157, 223, 121, 50, 168, 223, 109, 48, 176, 223, 99, 46, 182, 223, 93, 44, 187, 223, 89, 43, 190, 223, 88, 43, 190, 223, 89, 44, 190, 223, 91, 44, 188, 223, 96, 45, 185, 223, 107, 47, 178, 223, 120, 50, 169, 223, 132, 53, 161, 223, 145, 56, 152, 223, 157, 58, 143, 223, 167, 60, 137, 223, 173, 61, 133, 223, 179, 63, 130, 223, 182, 63, 127, 223, 184, 64, 125, 223, 184, 63, 126, 223, 184, 63, 126, 223, 181, 62, 128, 223, 178, 62, 129, 223, 175, 62, 132, 223, 171, 61, 135, 223, 167, 59, 137, 223, 160, 58, 142, 223, 155, 57, 146, 223, 152, 56, 147, 223, 150, 56, 148, 223, 152, 57, 147, 223, 158, 58, 144, 223, 166, 60, 138, 223, 181, 63, 128, 223, 199, 67, 115, 223, 216, 70, 104, 223, 228, 72, 96, 223, 239, 75, 89, 223, 248, 77, 82, 223, 254, 77, 79, 223, 192, 69, 123, 223, 169, 63, 139, 223, 165, 61, 141, 223, 168, 62, 139, 223, 176, 65, 134, 223, 185, 66, 128, 223, 190, 68, 125, 223, 195, 69, 121, 223, 199, 70, 119, 223, 201, 70, 117, 223, 202, 70, 117, 223, 202, 70, 117, 223, 202, 70, 117, 223, 201, 69, 117, 223, 199, 70, 119, 223, 198, 70, 120, 223, 196, 69, 121, 223, 193, 69, 122, 223, 189, 67, 125, 223, 182, 65, 130, 223, 171, 63, 138, 223, 155, 59, 147, 223, 139, 56, 158, 223, 123, 52, 168, 223, 110, 49, 177, 223, 100, 47, 183, 223, 94, 46, 187, 223, 92, 45, 189, 223, 91, 45, 189, 223, 94, 45, 187, 223, 99, 47, 184, 223, 106, 48, 179, 223, 114, 50, 174, 223, 128, 54, 165, 223, 142, 56, 156, 223, 154, 59, 148, 223, 164, 62, 141, 223, 172, 63, 137, 223, 178, 64, 133, 223, 181, 65, 130, 223, 184, 66, 128, 223, 185, 66, 128, 223, 186, 66, 127, 223, 185, 66, 127, 223, 182, 66, 129, 223, 179, 65, 131, 223, 176, 63, 134, 223, 171, 63, 136, 223, 168, 63, 139, 223, 162, 60, 143, 223, 154, 59, 148, 223, 148, 57, 151, 223, 144, 57, 155, 223, 141, 56, 157, 223, 139, 56, 157, 223, 141, 56, 156, 223, 148, 58, 152, 223, 159, 60, 144, 223, 179, 64, 132, 223, 197, 69, 120, 223, 214, 73, 108, 223, 229, 76, 99, 223, 244, 79, 89, 223, 253, 81, 83, 223, 204, 74, 119, 223, 185, 69, 130, 223, 184, 68, 131, 223, 187, 70, 129, 223, 193, 71, 126, 223, 199, 72, 121, 223, 202, 74, 121, 223, 202, 73, 120, 223, 202, 74, 120, 223, 202, 74, 120, 223, 202, 74, 120, 223, 202, 74, 120, 223, 202, 73, 120, 223, 199, 73, 122, 223, 198, 72, 123, 223, 196, 72, 124, 223, 193, 71, 126, 223, 189, 70, 128, 223, 181, 67, 133, 223, 171, 66, 139, 223, 158, 62, 148, 223, 141, 58, 158, 223, 126, 54, 167, 223, 113, 51, 176, 223, 103, 49, 182, 223, 97, 47, 186, 223, 94, 46, 188, 223, 95, 47, 187, 223, 98, 48, 185, 223, 104, 49, 181, 223, 112, 51, 177, 223, 122, 53, 170, 223, 135, 56, 162, 223, 148, 59, 154, 223, 160, 63, 145, 223, 170, 65, 140, 223, 177, 67, 135, 223, 181, 68, 133, 223, 184, 68, 131, 223, 184, 68, 131, 223, 184, 68, 131, 223, 185, 69, 130, 223, 186, 69, 130, 223, 184, 68, 131, 223, 181, 68, 133, 223, 177, 67, 134, 223, 172, 65, 138, 223, 168, 65, 141, 223, 163, 64, 144, 223, 157, 62, 148, 223, 149, 60, 153, 223, 142, 58, 157, 223, 136, 57, 162, 223, 130, 55, 165, 223, 127, 54, 167, 223, 125, 54, 168, 223, 130, 55, 165, 223, 140, 58, 159, 223, 159, 63, 146, 223, 180, 68, 133, 223, 200, 72, 121, 223, 221, 78, 108, 223, 240, 82, 96, 223, 253, 86, 86, 223, 218, 81, 112, 223, 205, 76, 121, 223, 202, 76, 122, 223, 202, 76, 122, 223, 206, 77, 119, 223, 209, 78, 119, 223, 207, 77, 119, 223, 205, 77, 120, 223, 205, 77, 121, 223, 203, 77, 122, 223, 202, 76, 122, 223, 202, 76, 122, 223, 201, 75, 123, 223, 198, 75, 125, 223, 196, 75, 126, 223, 195, 74, 127, 223, 190, 72, 129, 223, 183, 71, 135, 223, 172, 68, 141, 223, 157, 64, 150, 223, 142, 60, 159, 223, 127, 56, 169, 223, 115, 53, 176, 223, 105, 50, 182, 223, 99, 49, 185, 223, 98, 48, 187, 223, 99, 49, 186, 223, 105, 50, 182, 223, 112, 52, 178, 223, 120, 54, 173, 223, 131, 57, 166, 223, 143, 60, 159, 223, 156, 63, 151, 223, 164, 65, 145, 223, 173, 68, 140, 223, 179, 70, 137, 223, 183, 71, 134, 223, 185, 71, 133, 223, 186, 72, 132, 223, 186, 72, 132, 223, 184, 72, 133, 223, 183, 71, 134, 223, 181, 70, 134, 223, 180, 69, 135, 223, 177, 69, 137, 223, 173, 68, 140, 223, 169, 67, 143, 223, 163, 65, 146, 223, 159, 64, 149, 223, 152, 63, 153, 223, 145, 61, 157, 223, 137, 58, 162, 223, 128, 56, 168, 223, 120, 54, 173, 223, 113, 52, 177, 223, 111, 52, 178, 223, 113, 52, 177, 223, 121, 54, 172, 223, 139, 59, 161, 223, 161, 65, 147, 223, 187, 71, 131, 223, 212, 77, 116, 223, 236, 84, 101, 223, 253, 89, 91, 223, 231, 87, 108, 223, 220, 83, 116, 223, 218, 83, 116, 223, 217, 83, 117, 223, 217, 83, 117, 223, 216, 83, 118, 223, 213, 82, 120, 223, 209, 81, 121, 223, 205, 80, 123, 223, 203, 78, 124, 223, 202, 79, 125, 223, 202, 79, 126, 223, 199, 78, 127, 223, 197, 78, 128, 223, 194, 76, 130, 223, 189, 75, 133, 223, 182, 73, 137, 223, 171, 70, 143, 223, 159, 66, 151, 223, 143, 62, 160, 223, 129, 58, 169, 223, 117, 55, 176, 223, 108, 52, 181, 223, 103, 51, 184, 223, 102, 50, 185, 223, 105, 51, 183, 223, 109, 53, 180, 223, 118, 55, 175, 223, 128, 57, 170, 223, 139, 61, 163, 223, 149, 64, 156, 223, 161, 67, 150, 223, 172, 69, 144, 223, 177, 72, 139, 223, 182, 73, 138, 223, 185, 73, 136, 223, 187, 74, 134, 223, 187, 74, 133, 223, 187, 74, 133, 223, 186, 73, 135, 223, 184, 73, 136, 223, 181, 72, 137, 223, 179, 72, 139, 223, 176, 70, 141, 223, 174, 70, 142, 223, 169, 69, 144, 223, 165, 68, 147, 223, 159, 66, 151, 223, 153, 64, 154, 223, 146, 63, 158, 223, 139, 60, 163, 223, 130, 58, 168, 223, 120, 55, 174, 223, 111, 53, 179, 223, 105, 52, 183, 223, 102, 50, 185, 223, 101, 50, 185, 223, 108, 52, 181, 223, 125, 56, 171, 223, 146, 63, 159, 223, 172, 70, 142, 223, 199, 77, 127, 223, 224, 84, 112, 223, 245, 90, 99, 223, 239, 93, 108, 223, 230, 91, 112, 223, 226, 90, 114, 223, 226, 89, 115, 223, 224, 88, 116, 223, 223, 88, 117, 223, 219, 87, 119, 223, 213, 85, 122, 223, 209, 84, 124, 223, 205, 83, 126, 223, 203, 82, 127, 223, 202, 81, 128, 223, 198, 81, 131, 223, 195, 80, 132, 223, 190, 78, 135, 223, 180, 75, 140, 223, 170, 72, 147, 223, 156, 67, 155, 223, 142, 63, 163, 223, 129, 59, 170, 223, 118, 56, 176, 223, 111, 54, 181, 223, 107, 53, 183, 223, 107, 53, 183, 223, 111, 54, 181, 223, 118, 56, 177, 223, 127, 59, 171, 223, 137, 62, 166, 223, 148, 65, 159, 223, 156, 68, 154, 223, 164, 71, 150, 223, 173, 73, 145, 223, 180, 75, 141, 223, 184, 75, 139, 223, 187, 77, 137, 223, 187, 77, 136, 223, 188, 77, 135, 223, 188, 77, 135, 223, 187, 77, 137, 223, 185, 76, 138, 223, 182, 75, 139, 223, 179, 74, 141, 223, 176, 74, 143, 223, 173, 72, 144, 223, 169, 71, 146, 223, 166, 70, 149, 223, 160, 68, 152, 223, 153, 67, 156, 223, 146, 64, 160, 223, 139, 62, 164, 223, 132, 60, 168, 223, 123, 57, 173, 223, 113, 54, 179, 223, 105, 52, 184, 223, 99, 50, 187, 223, 96, 49, 190, 223, 95, 49, 189, 223, 101, 51, 186, 223, 115, 55, 178, 223, 134, 61, 168, 223, 156, 67, 155, 223, 179, 73, 142, 223, 202, 81, 127, 223, 225, 88, 115, 223, 246, 99, 107, 223, 239, 97, 111, 223, 235, 95, 113, 223, 233, 95, 113, 223, 231, 93, 115, 223, 227, 92, 117, 223, 221, 91, 120, 223, 216, 89, 124, 223, 211, 87, 126, 223, 206, 86, 128, 223, 203, 84, 131, 223, 200, 84, 133, 223, 197, 83, 134, 223, 191, 80, 137, 223, 181, 77, 143, 223, 170, 74, 149, 223, 156, 70, 157, 223, 142, 65, 165, 223, 130, 61, 171, 223, 120, 58, 177, 223, 114, 57, 180, 223, 112, 56, 181, 223, 114, 56, 180, 223, 118, 57, 178, 223, 125, 59, 174, 223, 135, 63, 168, 223, 146, 66, 162, 223, 156, 69, 157, 223, 164, 72, 152, 223, 173, 75, 147, 223, 179, 78, 144, 223, 182, 78, 142, 223, 187, 79, 140, 223, 187, 79, 139, 223, 187, 79, 138, 223, 189, 80, 138, 223, 189, 80, 138, 223, 187, 79, 139, 223, 186, 79, 140, 223, 184, 78, 141, 223, 181, 78, 142, 223, 178, 76, 145, 223, 174, 75, 146, 223, 170, 74, 148, 223, 167, 73, 151, 223, 161, 71, 154, 223, 155, 69, 158, 223, 148, 67, 161, 223, 140, 64, 166, 223, 132, 62, 170, 223, 124, 59, 174, 223, 115, 56, 179, 223, 107, 54, 184, 223, 100, 51, 188, 223, 96, 50, 190, 223, 92, 49, 192, 223, 92, 49, 192, 223, 97, 50, 190, 223, 110, 55, 182, 223, 126, 60, 173, 223, 146, 65, 162, 223, 168, 73, 150, 223, 192, 81, 136, 223, 214, 87, 123, 223, 250, 104, 108, 223, 246, 102, 110, 223, 243, 101, 113, 223, 238, 99, 114, 223, 235, 98, 116, 223, 229, 97, 119, 223, 223, 94, 123, 223, 216, 92, 126, 223, 211, 90, 129, 223, 206, 89, 131, 223, 202, 87, 134, 223, 197, 85, 137, 223, 189, 82, 141, 223, 180, 79, 146, 223, 168, 75, 152, 223, 155, 71, 159, 223, 143, 67, 166, 223, 133, 64, 171, 223, 125, 61, 175, 223, 121, 59, 178, 223, 120, 60, 178, 223, 124, 61, 176, 223, 130, 62, 172, 223, 139, 66, 168, 223, 148, 68, 163, 223, 156, 71, 158, 223, 164, 74, 154, 223, 172, 76, 150, 223, 177, 79, 147, 223, 181, 80, 145, 223, 185, 81, 143, 223, 187, 83, 142, 223, 188, 82, 141, 223, 188, 83, 141, 223, 188, 83, 141, 223, 187, 82, 142, 223, 187, 82, 142, 223, 185, 81, 143, 223, 183, 81, 144, 223, 181, 80, 145, 223, 180, 80, 146, 223, 177, 79, 146, 223, 174, 77, 148, 223, 170, 77, 151, 223, 165, 75, 153, 223, 158, 72, 157, 223, 150, 69, 162, 223, 141, 66, 166, 223, 133, 64, 171, 223, 125, 61, 175, 223, 118, 59, 179, 223, 110, 56, 183, 223, 103, 53, 187, 223, 97, 52, 190, 223, 94, 50, 192, 223, 91, 50, 194, 223, 91, 49, 194, 223, 96, 51, 191, 223, 109, 56, 184, 223, 125, 61, 175, 223, 146, 68, 164, 223, 169, 76, 151, 223, 195, 84, 137, 223, 219, 92, 124, 223, 253, 109, 109, 223, 251, 107, 111, 223, 247, 106, 114, 223, 243, 104, 116, 223, 236, 102, 119, 223, 230, 100, 122, 223, 222, 97, 126, 223, 214, 95, 130, 223, 208, 93, 134, 223, 203, 91, 136, 223, 198, 88, 139, 223, 190, 86, 143, 223, 180, 82, 148, 223, 168, 78, 154, 223, 156, 74, 160, 223, 144, 70, 167, 223, 135, 66, 172, 223, 128, 63, 176, 223, 126, 63, 177, 223, 126, 63, 176, 223, 130, 64, 174, 223, 139, 67, 170, 223, 148, 71, 164, 223, 159, 75, 159, 223, 168, 78, 155, 223, 174, 80, 151, 223, 180, 82, 148, 223, 184, 83, 145, 223, 187, 84, 144, 223, 189, 85, 143, 223, 189, 85, 143, 223, 189, 85, 143, 223, 189, 85, 143, 223, 188, 85, 143, 223, 187, 84, 144, 223, 186, 84, 145, 223, 184, 83, 146, 223, 182, 83, 147, 223, 181, 82, 147, 223, 179, 82, 148, 223, 177, 81, 149, 223, 174, 80, 151, 223, 170, 78, 153, 223, 167, 78, 155, 223, 162, 75, 158, 223, 153, 73, 161, 223, 143, 69, 167, 223, 134, 66, 172, 223, 126, 63, 176, 223, 118, 60, 180, 223, 111, 58, 184, 223, 105, 55, 188, 223, 99, 53, 190, 223, 95, 52, 192, 223, 94, 51, 193, 223, 93, 51, 193, 223, 94, 51, 193, 223, 101, 53, 189, 223, 113, 58, 183, 223, 130, 64, 174, 223, 152, 72, 162, 223, 177, 81, 150, 223, 202, 90, 136, 223, 225, 98, 123, 223, 253, 113, 113, 223, 251, 111, 115, 223, 247, 110, 117, 223, 242, 108, 120, 223, 234, 105, 124, 223, 227, 102, 127, 223, 216, 98, 131, 223, 208, 95, 136, 223, 201, 93, 140, 223, 195, 90, 143, 223, 186, 87, 147, 223, 176, 84, 153, 223, 166, 79, 157, 223, 156, 75, 162, 223, 147, 72, 167, 223, 139, 69, 171, 223, 136, 68, 173, 223, 134, 67, 174, 223, 136, 68, 172, 223, 142, 70, 169, 223, 149, 72, 166, 223, 156, 76, 162, 223, 164, 79, 158, 223, 173, 82, 153, 223, 180, 84, 150, 223, 182, 85, 149, 223, 185, 86, 148, 223, 187, 87, 147, 223, 190, 88, 146, 223, 191, 89, 146, 223, 191, 89, 145, 223, 189, 88, 146, 223, 188, 87, 146, 223, 188, 87, 146, 223, 187, 87, 147, 223, 184, 86, 148, 223, 183, 86, 148, 223, 181, 85, 149, 223, 179, 84, 151, 223, 176, 82, 152, 223, 173, 82, 154, 223, 167, 79, 157, 223, 161, 77, 160, 223, 155, 75, 163, 223, 150, 73, 165, 223, 141, 70, 170, 223, 131, 66, 175, 223, 124, 63, 178, 223, 117, 61, 182, 223, 111, 59, 185, 223, 106, 56, 188, 223, 101, 55, 190, 223, 98, 54, 192, 223, 97, 53, 192, 223, 97, 53, 192, 223, 100, 54, 190, 223, 106, 57, 187, 223, 116, 60, 182, 223, 132, 66, 174, 223, 152, 74, 164, 223, 174, 82, 153, 223, 197, 90, 142, 223, 218, 98, 131, 223, 235, 104, 122, 223, 253, 117, 116, 223, 250, 114, 119, 223, 245, 111, 122, 223, 238, 110, 125, 223, 230, 108, 129, 223, 222, 103, 132, 223, 211, 99, 137, 223, 201, 96, 142, 223, 193, 92, 147, 223, 185, 89, 150, 223, 175, 85, 155, 223, 164, 81, 161, 223, 154, 77, 165, 223, 146, 73, 170, 223, 141, 71, 172, 223, 138, 71, 173, 223, 139, 71, 173, 223, 142, 72, 171, 223, 149, 75, 168, 223, 158, 79, 164, 223, 166, 81, 159, 223, 173, 84, 156, 223, 179, 86, 154, 223, 185, 89, 150, 223, 187, 90, 150, 223, 189, 91, 148, 223, 190, 90, 147, 223, 192, 92, 147, 223, 193, 92, 147, 223, 191, 92, 148, 223, 189, 90, 147, 223, 188, 90, 149, 223, 187, 89, 149, 223, 186, 89, 150, 223, 185, 89, 151, 223, 182, 88, 152, 223, 180, 87, 153, 223, 178, 86, 154, 223, 176, 85, 155, 223, 172, 83, 156, 223, 167, 82, 159, 223, 159, 79, 163, 223, 151, 76, 166, 223, 145, 73, 169, 223, 139, 71, 173, 223, 131, 68, 176, 223, 123, 64, 180, 223, 116, 62, 184, 223, 111, 60, 186, 223, 107, 58, 188, 223, 103, 56, 191, 223, 101, 56, 191, 223, 99, 55, 192, 223, 100, 55, 192, 223, 104, 57, 190, 223, 110, 59, 187, 223, 121, 63, 181, 223, 136, 70, 174, 223, 154, 77, 165, 223, 175, 84, 155, 223, 197, 93, 143, 223, 216, 101, 134, 223, 231, 107, 128, 223, 242, 111, 121, 223, 250, 119, 123, 223, 245, 115, 125, 223, 238, 113, 128, 223, 230, 110, 132, 223, 223, 108, 135, 223, 215, 105, 140, 223, 204, 99, 144, 223, 193, 94, 150, 223, 183, 90, 154, 223, 173, 87, 159, 223, 163, 82, 163, 223, 153, 78, 168, 223, 148, 76, 171, 223, 145, 75, 172, 223, 145, 75, 171, 223, 147, 76, 171, 223, 151, 78, 169, 223, 157, 79, 166, 223, 164, 83, 163, 223, 171, 85, 160, 223, 176, 87, 157, 223, 180, 89, 156, 223, 183, 91, 154, 223, 186, 92, 152, 223, 188, 93, 151, 223, 188, 93, 151, 223, 188, 93, 151, 223, 188, 93, 151, 223, 188, 93, 151, 223, 187, 92, 151, 223, 186, 91, 153, 223, 184, 91, 153, 223, 183, 91, 154, 223, 181, 90, 154, 223, 180, 89, 155, 223, 177, 88, 156, 223, 175, 87, 157, 223, 171, 85, 159, 223, 167, 84, 161, 223, 161, 81, 164, 223, 153, 78, 168, 223, 146, 75, 171, 223, 140, 73, 174, 223, 134, 70, 177, 223, 127, 67, 180, 223, 122, 65, 183, 223, 118, 64, 184, 223, 112, 61, 187, 223, 109, 60, 188, 223, 106, 58, 190, 223, 104, 58, 191, 223, 104, 58, 191, 223, 105, 58, 190, 223, 110, 61, 188, 223, 118, 63, 184, 223, 129, 68, 179, 223, 143, 74, 172, 223, 160, 81, 164, 223, 179, 89, 156, 223, 197, 96, 147, 223, 214, 103, 138, 223, 228, 109, 132, 223, 238, 112, 128, 223, 245, 115, 124, 223, 246, 121, 129, 223, 240, 117, 131, 223, 231, 114, 135, 223, 223, 110, 138, 223, 216, 107, 142, 223, 207, 103, 145, 223, 197, 99, 150, 223, 185, 93, 156, 223, 173, 89, 161, 223, 162, 84, 166, 223, 151, 79, 170, 223, 144, 76, 174, 223, 142, 75, 175, 223, 146, 77, 173, 223, 150, 79, 171, 223, 156, 81, 168, 223, 164, 84, 165, 223, 172, 88, 161, 223, 177, 91, 159, 223, 180, 92, 157, 223, 184, 93, 156, 223, 184, 93, 156, 223, 185, 94, 155, 223, 187, 95, 155, 223, 187, 95, 155, 223, 187, 94, 155, 223, 187, 95, 155, 223, 184, 93, 156, 223, 182, 92, 156, 223, 181, 92, 158, 223, 179, 91, 157, 223, 179, 92, 157, 223, 179, 91, 158, 223, 176, 90, 159, 223, 175, 89, 160, 223, 171, 88, 161, 223, 168, 86, 163, 223, 163, 85, 165, 223, 158, 82, 168, 223, 150, 79, 171, 223, 142, 75, 174, 223, 136, 73, 177, 223, 130, 70, 179, 223, 124, 68, 183, 223, 119, 66, 185, 223, 116, 64, 186, 223, 114, 63, 187, 223, 111, 62, 188, 223, 109, 61, 190, 223, 107, 60, 190, 223, 107, 60, 190, 223, 110, 62, 189, 223, 114, 63, 188, 223, 122, 67, 183, 223, 135, 72, 178, 223, 149, 78, 172, 223, 167, 86, 163, 223, 186, 94, 155, 223, 203, 101, 147, 223, 218, 107, 141, 223, 229, 112, 136, 223, 239, 117, 131, 223, 243, 119, 129, 223, 247, 120, 126, 223, 242, 122, 133, 223, 233, 118, 138, 223, 224, 114, 142, 223, 215, 110, 145, 223, 206, 106, 149, 223, 197, 102, 153, 223, 183, 96, 159, 223, 169, 89, 165, 223, 159, 85, 169, 223, 151, 81, 173, 223, 147, 79, 175, 223, 145, 79, 175, 223, 147, 80, 174, 223, 151, 81, 172, 223, 157, 84, 170, 223, 163, 86, 167, 223, 170, 89, 165, 223, 176, 93, 162, 223, 180, 94, 161, 223, 181, 94, 159, 223, 181, 95, 159, 223, 181, 95, 159, 223, 181, 95, 159, 223, 181, 95, 159, 223, 181, 95, 159, 223, 180, 94, 159, 223, 177, 93, 161, 223, 175, 91, 162, 223, 172, 91, 163, 223, 172, 90, 164, 223, 170, 90, 164, 223, 170, 90, 164, 223, 169, 89, 164, 223, 166, 88, 166, 223, 162, 86, 168, 223, 158, 84, 169, 223, 154, 83, 171, 223, 148, 80, 173, 223, 142, 77, 177, 223, 134, 74, 179, 223, 128, 71, 182, 223, 126, 69, 183, 223, 124, 69, 184, 223, 122, 68, 185, 223, 121, 68, 186, 223, 121, 68, 185, 223, 121, 67, 185, 223, 119, 67, 186, 223, 118, 66, 187, 223, 118, 66, 187, 223, 120, 67, 185, 223, 124, 69, 184, 223, 132, 72, 181, 223, 141, 77, 176, 223, 153, 82, 171, 223, 167, 88, 165, 223, 183, 95, 158, 223, 200, 102, 151, 223, 213, 108, 146, 223, 224, 114, 140, 223, 233, 117, 136, 223, 241, 121, 133, 223, 245, 124, 132, 223, 249, 124, 130, 223, 237, 123, 140, 223, 0, 0, 0, 223, 0, 0, 0, 223, 206, 108, 151, 223, 197, 104, 156, 223, 185, 100, 161, 223, 172, 93, 167, 223, 81, 44, 89, 223, 0, 0, 0, 223, 0, 0, 0, 223, 142, 79, 178, 223, 145, 80, 177, 223, 150, 83, 175, 223, 156, 84, 171, 223, 97, 52, 102, 223, 35, 19, 34, 223, 6, 3, 6, 223, 6, 3, 6, 223, 36, 19, 33, 223, 108, 57, 98, 223, 178, 95, 162, 223, 178, 96, 164, 223, 176, 95, 163, 223, 176, 95, 163, 223, 175, 94, 164, 223, 171, 92, 166, 223, 168, 91, 168, 223, 164, 89, 169, 223, 0, 0, 0, 223, 0, 0, 0, 223, 0, 0, 0, 223, 0, 0, 0, 223, 3, 1, 3, 223, 19, 10, 22, 223, 76, 41, 91, 223, 139, 77, 171, 223, 140, 77, 179, 223, 120, 67, 162, 223, 0, 0, 0, 223, 0, 0, 0, 223, 101, 58, 161, 223, 118, 68, 188, 223, 120, 69, 187, 223, 122, 70, 186, 223, 109, 62, 162, 223, 0, 0, 0, 223, 0, 0, 0, 223, 101, 56, 142, 223, 129, 72, 183, 223, 131, 73, 182, 223, 0, 0, 0, 223, 0, 0, 0, 223, 150, 83, 175, 223, 160, 87, 171, 223, 154, 83, 148, 223, 0, 0, 0, 223, 0, 0, 0, 223, 184, 96, 127, 223, 223, 116, 144, 223, 231, 120, 141, 223, 237, 122, 138, 223, 213, 110, 119, 223, 0, 0, 0, 223, 0, 0, 0, 223, 229, 122, 146, 223, 0, 0, 0, 223, 0, 0, 0, 223, 191, 104, 160, 223, 182, 100, 164, 223, 173, 95, 167, 223, 138, 77, 149, 223, 5, 2, 6, 223, 0, 0, 0, 223, 0, 0, 0, 223, 140, 80, 181, 223, 144, 82, 179, 223, 150, 85, 177, 223, 54, 30, 61, 223, 0, 0, 0, 223, 0, 0, 0, 223, 0, 0, 0, 223, 0, 0, 0, 223, 0, 0, 0, 223, 0, 0, 0, 223, 60, 33, 63, 223, 162, 90, 172, 223, 160, 89, 173, 223, 157, 88, 174, 223, 153, 86, 175, 223, 150, 85, 176, 223, 149, 83, 178, 223, 145, 82, 178, 223, 0, 0, 0, 223, 0, 0, 0, 223, 0, 0, 0, 223, 0, 0, 0, 223, 0, 0, 0, 223, 0, 0, 0, 223, 0, 0, 0, 223, 27, 15, 39, 223, 123, 71, 181, 223, 124, 71, 187, 223, 23, 13, 36, 223, 0, 0, 0, 223, 90, 52, 136, 223, 126, 73, 186, 223, 130, 75, 185, 223, 132, 76, 183, 223, 99, 56, 133, 223, 0, 0, 0, 223, 13, 7, 17, 223, 143, 80, 178, 223, 146, 82, 178, 223, 148, 83, 177, 223, 0, 0, 0, 223, 0, 0, 0, 223, 168, 92, 169, 223, 178, 97, 165, 223, 188, 103, 161, 223, 38, 20, 29, 223, 0, 0, 0, 223, 162, 87, 107, 223, 230, 123, 145, 223, 237, 126, 142, 223, 241, 128, 140, 223, 181, 96, 101, 223, 0, 0, 0, 223, 24, 13, 13, 223, 220, 121, 152, 223, 255, 210, 0, 223, 255, 210, 0, 223, 178, 101, 168, 223, 168, 96, 172, 223, 160, 91, 175, 223, 42, 24, 51, 223, 123, 101, 0, 223, 255, 210, 0, 223, 255, 210, 0, 223, 137, 80, 184, 223, 143, 83, 181, 223, 96, 55, 115, 223, 1, 0, 0, 223, 105, 85, 3, 223, 220, 176, 21, 223, 249, 204, 6, 223, 249, 204, 6, 223, 221, 177, 21, 223, 103, 84, 3, 223, 1, 0, 0, 223, 98, 56, 118, 223, 145, 83, 180, 223, 139, 80, 183, 223, 135, 79, 184, 223, 132, 77, 185, 223, 130, 76, 186, 223, 128, 75, 187, 223, 255, 210, 0, 223, 255, 210, 0, 223, 255, 210, 0, 223, 255, 210, 0, 223, 252, 207, 3, 223, 233, 189, 19, 223, 132, 106, 15, 223, 8, 6, 0, 223, 67, 40, 110, 223, 130, 83, 171, 223, 255, 210, 0, 223, 255, 210, 0, 223, 102, 68, 95, 223, 135, 79, 184, 223, 141, 82, 181, 223, 144, 83, 180, 223, 106, 69, 92, 223, 255, 210, 0, 223, 255, 210, 0, 223, 179, 116, 137, 223, 162, 93, 174, 223, 168, 94, 172, 223, 255, 210, 0, 223, 255, 210, 0, 223, 185, 104, 165, 223, 194, 109, 162, 223, 209, 121, 141, 223, 255, 210, 0, 223, 255, 210, 0, 223, 154, 93, 76, 223, 237, 130, 146, 223, 241, 131, 144, 223, 246, 134, 141, 223, 160, 94, 72, 223, 255, 210, 0, 223, 255, 210, 0, 223, 208, 118, 161, 223, 255, 210, 0, 223, 255, 210, 0, 223, 162, 94, 176, 223, 155, 91, 179, 223, 99, 58, 120, 223, 34, 28, 0, 223, 246, 203, 1, 223, 255, 210, 0, 223, 255, 210, 0, 223, 130, 77, 188, 223, 132, 79, 187, 223, 34, 20, 48, 223, 165, 135, 0, 223, 255, 210, 0, 223, 255, 210, 0, 223, 255, 210, 0, 223, 255, 210, 0, 223, 255, 210, 0, 223, 255, 210, 0, 223, 161, 132, 0, 223, 34, 20, 50, 223, 125, 75, 189, 223, 122, 73, 191, 223, 119, 72, 191, 223, 118, 72, 192, 223, 117, 70, 193, 223, 115, 70, 193, 223, 255, 210, 0, 223, 255, 210, 0, 223, 255, 210, 0, 223, 255, 210, 0, 223, 255, 210, 0, 223, 255, 210, 0, 223, 255, 210, 0, 223, 201, 165, 0, 223, 31, 20, 42, 223, 124, 74, 190, 223, 225, 181, 28, 223, 255, 210, 0, 223, 69, 56, 0, 223, 0, 0, 0, 223, 0, 0, 0, 223, 0, 0, 0, 223, 68, 56, 0, 223, 255, 210, 0, 223, 241, 195, 12, 223, 173, 101, 170, 223, 177, 102, 170, 223, 181, 103, 168, 223, 255, 210, 0, 223, 255, 210, 0, 223, 198, 113, 163, 223, 205, 116, 160, 223, 214, 121, 157, 223, 239, 188, 23, 223, 255, 210, 0, 223, 69, 56, 0, 223, 0, 0, 0, 223, 0, 0, 0, 223, 0, 0, 0, 223, 68, 56, 0, 223, 255, 210, 0, 223, 247, 198, 10, 223, 196, 115, 167, 223, 255, 210, 0, 223, 255, 210, 0, 223, 149, 89, 183, 223, 135, 80, 175, 223, 14, 8, 18, 223, 182, 150, 1, 223, 255, 210, 0, 223, 255, 210, 0, 223, 255, 210, 0, 223, 121, 75, 192, 223, 122, 75, 192, 223, 95, 76, 8, 223, 255, 210, 0, 223, 249, 205, 5, 223, 174, 128, 113, 223, 125, 80, 181, 223, 126, 81, 182, 223, 172, 127, 116, 223, 248, 204, 6, 223, 255, 210, 0, 223, 91, 73, 9, 223, 109, 68, 196, 223, 106, 66, 197, 223, 104, 65, 198, 223, 104, 65, 198, 223, 104, 65, 198, 223, 102, 64, 199, 223, 255, 210, 0, 223, 255, 210, 0, 223, 106, 66, 197, 223, 105, 66, 198, 223, 108, 68, 194, 223, 139, 98, 155, 223, 230, 186, 29, 223, 255, 210, 0, 223, 110, 90, 6, 223, 132, 80, 188, 223, 200, 149, 90, 223, 255, 210, 0, 223, 103, 84, 0, 223, 0, 0, 0, 223, 0, 0, 0, 223, 0, 0, 0, 223, 105, 86, 0, 223, 255, 210, 0, 223, 224, 168, 67, 223, 189, 110, 169, 223, 193, 113, 167, 223, 196, 114, 166, 223, 255, 210, 0, 223, 255, 210, 0, 223, 210, 122, 162, 223, 216, 125, 160, 223, 223, 129, 157, 223, 242, 171, 75, 223, 255, 210, 0, 223, 103, 84, 0, 223, 0, 0, 0, 223, 0, 0, 0, 223, 0, 0, 0, 223, 105, 86, 0, 223, 255, 210, 0, 223, 252, 182, 57, 223, 180, 109, 175, 223, 255, 210, 0, 223, 255, 210, 0, 223, 133, 82, 190, 223, 55, 34, 82, 223, 85, 70, 0, 223, 255, 210, 0, 223, 217, 172, 52, 223, 255, 210, 0, 223, 255, 210, 0, 223, 112, 71, 196, 223, 112, 71, 196, 223, 188, 155, 0, 223, 255, 210, 0, 223, 172, 131, 107, 223, 107, 68, 198, 223, 106, 68, 199, 223, 108, 68, 198, 223, 108, 69, 198, 223, 171, 130, 108, 223, 255, 210, 0, 223, 185, 152, 0, 223, 100, 64, 200, 223, 98, 63, 201, 223, 98, 63, 201, 223, 98, 62, 201, 223, 98, 63, 201, 223, 99, 63, 201, 223, 255, 210, 0, 223, 255, 210, 0, 223, 105, 67, 199, 223, 108, 68, 198, 223, 110, 70, 197, 223, 116, 73, 195, 223, 160, 114, 136, 223, 255, 210, 0, 223, 198, 163, 0, 223, 150, 91, 184, 223, 180, 120, 142, 223, 255, 210, 0, 223, 255, 210, 0, 223, 255, 210, 0, 223, 255, 210, 0, 223, 255, 210, 0, 223, 255, 210, 0, 223, 255, 210, 0, 223, 212, 143, 121, 223, 199, 119, 168, 223, 202, 121, 167, 223, 206, 123, 166, 223, 255, 210, 0, 223, 255, 210, 0, 223, 217, 128, 162, 223, 223, 132, 160, 223, 230, 136, 158, 223, 240, 154, 122, 223, 255, 210, 0, 223, 255, 210, 0, 223, 255, 210, 0, 223, 255, 210, 0, 223, 255, 210, 0, 223, 255, 210, 0, 223, 255, 210, 0, 223, 255, 166, 107, 223, 166, 103, 181, 223, 255, 210, 0, 223, 255, 210, 0, 223, 94, 60, 157, 223, 14, 10, 2, 223, 230, 189, 3, 223, 250, 205, 6, 223, 127, 88, 170, 223, 255, 210, 0, 223, 255, 210, 0, 223, 103, 67, 200, 223, 102, 66, 201, 223, 237, 195, 0, 223, 255, 210, 0, 223, 104, 72, 163, 223, 95, 62, 203, 223, 95, 62, 203, 223, 97, 63, 202, 223, 98, 64, 202, 223, 106, 73, 163, 223, 255, 210, 0, 223, 235, 194, 0, 223, 92, 60, 204, 223, 92, 60, 204, 223, 92, 60, 204, 223, 92, 60, 204, 223, 93, 61, 204, 223, 95, 62, 203, 223, 255, 210, 0, 223, 255, 210, 0, 223, 105, 68, 199, 223, 109, 70, 198, 223, 115, 73, 196, 223, 124, 79, 194, 223, 134, 87, 167, 223, 255, 210, 0, 223, 239, 197, 0, 223, 169, 104, 180, 223, 178, 110, 176, 223, 242, 197, 11, 223, 255, 210, 0, 223, 255, 210, 0, 223, 255, 210, 0, 223, 255, 210, 0, 223, 255, 210, 0, 223, 247, 202, 6, 223, 209, 128, 164, 223, 211, 128, 167, 223, 213, 129, 167, 223, 214, 131, 166, 223, 255, 210, 0, 223, 255, 210, 0, 223, 225, 137, 163, 223, 231, 140, 161, 223, 237, 143, 159, 223, 243, 147, 156, 223, 247, 199, 9, 223, 255, 210, 0, 223, 255, 210, 0, 223, 255, 210, 0, 223, 255, 210, 0, 223, 255, 210, 0, 223, 249, 203, 5, 223, 255, 155, 149, 223, 168, 106, 184, 223, 255, 210, 0, 223, 255, 210, 0, 223, 24, 16, 40, 223, 145, 119, 0, 223, 255, 210, 0, 223, 180, 139, 100, 223, 103, 68, 201, 223, 255, 210, 0, 223, 255, 210, 0, 223, 98, 64, 203, 223, 96, 63, 203, 223, 252, 208, 0, 223, 255, 210, 0, 223, 55, 37, 115, 223, 93, 62, 204, 223, 95, 63, 204, 223, 97, 64, 203, 223, 98, 65, 203, 223, 59, 40, 116, 223, 255, 210, 0, 223, 250, 206, 0, 223, 95, 63, 204, 223, 95, 63, 204, 223, 95, 63, 204, 223, 94, 62, 204, 223, 96, 63, 203, 223, 99, 65, 202, 223, 255, 210, 0, 223, 255, 210, 0, 223, 118, 76, 197, 223, 125, 81, 195, 223, 133, 85, 193, 223, 144, 92, 190, 223, 105, 68, 125, 223, 255, 210, 0, 223, 253, 208, 0, 223, 183, 115, 179, 223, 188, 119, 177, 223, 227, 173, 63, 223, 255, 210, 0, 223, 109, 89, 2, 223, 177, 110, 154, 223, 102, 83, 2, 223, 255, 210, 0, 223, 234, 179, 54, 223, 211, 132, 170, 223, 213, 133, 170, 223, 214, 133, 169, 223, 217, 135, 169, 223, 255, 210, 0, 223, 255, 210, 0, 223, 231, 143, 165, 223, 237, 146, 163, 223, 241, 150, 162, 223, 245, 152, 161, 223, 248, 185, 57, 223, 255, 210, 0, 223, 109, 89, 1, 223, 227, 139, 140, 223, 103, 84, 2, 223, 255, 210, 0, 223, 249, 188, 50, 223, 255, 157, 157, 223, 168, 109, 185, 223, 255, 210, 0, 223, 255, 210, 0, 223, 50, 41, 0, 223, 251, 207, 0, 223, 233, 189, 29, 223, 109, 73, 196, 223, 99, 66, 203, 223, 255, 210, 0, 223, 255, 210, 0, 223, 92, 62, 205, 223, 91, 61, 206, 223, 242, 198, 8, 223, 255, 210, 0, 223, 26, 21, 7, 223, 56, 37, 125, 223, 89, 60, 193, 223, 92, 61, 193, 223, 61, 40, 125, 223, 27, 21, 7, 223, 255, 210, 0, 223, 239, 196, 11, 223, 99, 66, 204, 223, 99, 66, 203, 223, 98, 66, 204, 223, 98, 65, 204, 223, 99, 66, 203, 223, 105, 69, 202, 223, 255, 210, 0, 223, 255, 210, 0, 223, 133, 87, 194, 223, 142, 92, 190, 223, 146, 95, 180, 223, 118, 77, 132, 223, 31, 23, 16, 223, 255, 210, 0, 223, 246, 201, 6, 223, 195, 125, 178, 223, 199, 127, 176, 223, 217, 153, 119, 223, 255, 210, 0, 223, 186, 153, 0, 223, 63, 40, 54, 223, 181, 149, 0, 223, 255, 210, 0, 223, 226, 160, 113, 223, 213, 136, 172, 223, 213, 137, 172, 223, 214, 136, 173, 223, 218, 140, 171, 223, 255, 210, 0, 223, 255, 210, 0, 223, 237, 150, 166, 223, 241, 153, 165, 223, 246, 157, 164, 223, 250, 158, 162, 223, 252, 176, 109, 223, 255, 210, 0, 223, 186, 153, 0, 223, 79, 49, 49, 223, 181, 149, 0, 223, 255, 210, 0, 223, 255, 177, 105, 223, 255, 161, 161, 223, 184, 121, 183, 223, 255, 210, 0, 223, 255, 210, 0, 223, 203, 167, 2, 223, 255, 210, 0, 223, 154, 114, 147, 223, 111, 75, 201, 223, 104, 70, 203, 223, 255, 210, 0, 223, 255, 210, 0, 223, 97, 66, 205, 223, 98, 67, 205, 223, 215, 173, 52, 223, 255, 210, 0, 223, 109, 89, 0, 223, 0, 0, 0, 223, 0, 0, 0, 223, 0, 0, 0, 223, 0, 0, 0, 223, 107, 88, 0, 223, 255, 210, 0, 223, 215, 172, 55, 223, 111, 75, 201, 223, 112, 75, 201, 223, 112, 76, 201, 223, 113, 76, 201, 223, 116, 77, 200, 223, 123, 82, 199, 223, 255, 210, 0, 223, 255, 210, 0, 223, 0, 0, 0, 223, 0, 0, 0, 223, 0, 0, 0, 223, 0, 0, 0, 223, 83, 68, 0, 223, 255, 210, 0, 223, 242, 191, 41, 223, 202, 131, 178, 223, 202, 132, 178, 223, 205, 136, 169, 223, 250, 206, 2, 223, 250, 205, 0, 223, 28, 23, 0, 223, 248, 204, 0, 223, 251, 206, 2, 223, 215, 142, 166, 223, 214, 140, 175, 223, 0, 0, 0, 223, 0, 0, 0, 223, 0, 0, 0, 223, 255, 210, 0, 223, 255, 210, 0, 223, 0, 0, 0, 223, 0, 0, 0, 223, 0, 0, 0, 223, 252, 163, 165, 223, 254, 166, 157, 223, 251, 206, 1, 223, 250, 205, 0, 223, 28, 23, 0, 223, 248, 204, 0, 223, 252, 207, 2, 223, 255, 167, 155, 223, 253, 163, 165, 223, 202, 136, 182, 223, 255, 210, 0, 223, 255, 210, 0, 223, 255, 210, 0, 223, 215, 170, 68, 223, 130, 88, 198, 223, 119, 81, 201, 223, 111, 76, 202, 223, 255, 210, 0, 223, 255, 210, 0, 223, 104, 71, 204, 223, 106, 73, 204, 223, 159, 121, 133, 223, 255, 210, 0, 223, 246, 203, 4, 223, 113, 90, 24, 223, 18, 14, 7, 223, 17, 13, 7, 223, 113, 91, 26, 223, 246, 202, 5, 223, 255, 210, 0, 223, 168, 126, 134, 223, 126, 86, 199, 223, 127, 87, 199, 223, 129, 87, 198, 223, 131, 89, 198, 223, 137, 92, 196, 223, 146, 98, 194, 223, 255, 210, 0, 223, 255, 210, 0, 223, 0, 0, 0, 223, 1, 0, 0, 223, 13, 10, 2, 223, 87, 69, 13, 223, 240, 195, 9, 223, 255, 210, 0, 223, 225, 166, 106, 223, 206, 137, 180, 223, 206, 137, 180, 223, 206, 137, 180, 223, 234, 185, 42, 223, 255, 210, 0, 223, 176, 144, 0, 223, 255, 210, 0, 223, 237, 187, 44, 223, 217, 144, 178, 223, 216, 143, 178, 223, 0, 0, 0, 223, 0, 0, 0, 223, 0, 0, 0, 223, 255, 210, 0, 223, 255, 210, 0, 223, 0, 0, 0, 223, 0, 0, 0, 223, 0, 0, 0, 223, 255, 169, 168, 223, 255, 169, 169, 223, 245, 192, 39, 223, 255, 210, 0, 223, 176, 144, 0, 223, 255, 210, 0, 223, 247, 193, 42, 223, 253, 167, 168, 223, 251, 167, 169, 223, 217, 148, 182, 223, 255, 210, 0, 223, 255, 210, 0, 223, 250, 204, 11, 223, 170, 119, 175, 223, 149, 102, 196, 223, 139, 96, 197, 223, 130, 90, 200, 223, 255, 210, 0, 223, 255, 210, 0, 223, 125, 87, 201, 223, 128, 89, 200, 223, 133, 91, 199, 223, 210, 166, 74, 223, 255, 210, 0, 223, 255, 210, 0, 223, 255, 210, 0, 223, 255, 210, 0, 223, 255, 210, 0, 223, 255, 210, 0, 223, 214, 168, 77, 223, 149, 102, 195, 223, 148, 102, 195, 223, 148, 102, 195, 223, 150, 103, 195, 223, 153, 105, 194, 223, 158, 109, 193, 223, 168, 115, 192, 223, 255, 210, 0, 223, 255, 210, 0, 223, 255, 210, 0, 223, 255, 210, 0, 223, 255, 210, 0, 223, 255, 210, 0, 223, 255, 210, 0, 223, 240, 187, 59, 223, 209, 142, 181, 223, 209, 142, 182, 223, 209, 143, 183, 223, 209, 143, 182, 223, 228, 171, 104, 223, 255, 210, 0, 223, 255, 210, 0, 223, 255, 210, 0, 223, 232, 172, 107, 223, 217, 147, 181, 223, 218, 147, 180, 223, 255, 210, 0, 223, 255, 210, 0, 223, 255, 210, 0, 223, 255, 210, 0, 223, 255, 210, 0, 223, 255, 210, 0, 223, 255, 210, 0, 223, 255, 210, 0, 223, 253, 171, 173, 223, 253, 170, 172, 223, 253, 187, 97, 223, 255, 210, 0, 223, 255, 210, 0, 223, 255, 210, 0, 223, 252, 185, 103, 223, 249, 169, 174, 223, 250, 168, 175, 223, 234, 163, 181, 223, 255, 210, 0, 223, 255, 210, 0, 223, 222, 167, 109, 223, 185, 129, 191, 223, 171, 120, 193, 223, 162, 113, 195, 223, 155, 108, 196, 223, 255, 210, 0, 223, 255, 210, 0, 223, 153, 107, 196, 223, 156, 109, 196, 223, 160, 112, 195, 223, 166, 116, 194, 223, 204, 156, 112, 223, 238, 192, 38, 223, 251, 206, 8, 223, 251, 206, 8, 223, 237, 191, 41, 223, 205, 155, 120, 223, 175, 122, 193, 223, 174, 121, 192, 223, 173, 120, 193, 223, 174, 121, 193, 223, 175, 122, 192, 223, 179, 125, 192, 223, 183, 128, 191, 223, 191, 132, 189, 223, 255, 210, 0, 223, 255, 210, 0, 223, 255, 210, 0, 223, 255, 210, 0, 223, 254, 208, 2, 223, 250, 203, 19, 223, 233, 177, 96, 223, 213, 149, 183, 223, 212, 147, 185, 223, 213, 147, 185, 223, 213, 149, 184, 223, 213, 149, 185, 223, 218, 155, 159, 223, 255, 210, 0, 223, 255, 210, 0, 223, 254, 209, 0, 223, 220, 155, 166, 223, 217, 150, 184, 223, 218, 150, 184, 223, 255, 210, 0, 223, 255, 210, 0, 223, 255, 210, 0, 223, 255, 210, 0, 223, 255, 210, 0, 223, 255, 210, 0, 223, 255, 210, 0, 223, 255, 210, 0, 223, 251, 174, 176, 223, 251, 172, 176, 223, 250, 177, 153, 223, 255, 210, 0, 223, 255, 210, 0, 223, 254, 209, 0, 223, 245, 173, 160, 223, 245, 171, 178, 223, 246, 170, 178, 223, 241, 171, 184, 223, 231, 164, 185, 223, 221, 157, 186, 223, 210, 149, 189, 223, 198, 141, 191, 223, 187, 133, 193, 223, 180, 128, 194, 223, 174, 124, 194, 223, 172, 122, 195, 223, 172, 122, 195, 223, 174, 124, 195, 223, 177, 125, 194, 223, 180, 128, 194, 223, 184, 131, 193, 223, 187, 133, 193, 223, 189, 135, 192, 223, 190, 135, 192, 223, 192, 136, 191, 223, 193, 137, 191, 223, 191, 136, 192, 223, 191, 136, 191, 223, 189, 135, 191, 223, 188, 133, 192, 223, 188, 134, 192, 223, 189, 135, 191, 223, 193, 136, 192, 223, 196, 139, 191, 223, 201, 143, 190, 223, 206, 146, 189, 223, 209, 147, 189, 223, 209, 149, 188, 223, 209, 149, 189, 223, 211, 149, 189, 223, 214, 151, 188, 223, 215, 153, 187, 223, 215, 152, 188, 223, 213, 151, 188, 223, 213, 151, 188, 223, 213, 151, 188, 223, 213, 152, 188, 223, 213, 151, 188, 223, 214, 151, 187, 223, 216, 153, 187, 223, 217, 153, 187, 223, 217, 154, 188, 223, 217, 153, 187, 223, 218, 153, 187, 223, 218, 155, 186, 223, 220, 155, 186, 223, 224, 158, 186, 223, 229, 161, 185, 223, 233, 165, 184, 223, 239, 169, 183, 223, 243, 172, 182, 223, 245, 174, 182, 223, 245, 174, 182, 223, 243, 172, 182, 223, 243, 171, 182, 223, 241, 170, 182, 223, 240, 170, 182, 223, 241, 170, 181, 223, 241, 170, 182, 223, 242, 170, 181, 223, 243, 172, 182, 223, 245, 177, 187, 223, 237, 172, 188, 223, 227, 164, 189, 223, 218, 157, 190, 223, 208, 151, 192, 223, 198, 144, 193, 223, 194, 140, 193, 223, 191, 139, 195, 223, 190, 138, 195, 223, 192, 139, 195, 223, 193, 139, 194, 223, 196, 141, 193, 223, 197, 143, 193, 223, 199, 144, 194, 223, 200, 144, 194, 223, 202, 146, 193, 223, 202, 146, 193, 223, 204, 149, 193, 223, 205, 149, 192, 223, 205, 148, 193, 223, 203, 147, 192, 223, 202, 146, 193, 223, 201, 145, 194, 223, 201, 146, 194, 223, 200, 144, 193, 223, 202, 146, 192, 223, 206, 148, 192, 223, 209, 150, 192, 223, 211, 153, 191, 223, 213, 153, 190, 223, 213, 155, 190, 223, 212, 153, 191, 223, 211, 153, 192, 223, 214, 155, 190, 223, 215, 155, 190, 223, 215, 155, 190, 223, 215, 155, 190, 223, 215, 155, 190, 223, 215, 155, 190, 223, 213, 154, 190, 223, 214, 155, 190, 223, 215, 155, 190, 223, 216, 155, 190, 223, 217, 156, 190, 223, 217, 156, 190, 223, 217, 156, 190, 223, 218, 157, 190, 223, 218, 158, 190, 223, 220, 159, 190, 223, 224, 162, 189, 223, 227, 164, 188, 223, 232, 167, 188, 223, 235, 169, 187, 223, 238, 172, 186, 223, 239, 172, 186, 223, 239, 172, 186, 223, 237, 172, 186, 223, 235, 169, 187, 223, 233, 168, 188, 223, 232, 168, 188, 223, 235, 170, 188, 223, 237, 171, 186, 223, 237, 171, 185, 223, 238, 172, 186, 223, 246, 182, 189, 223, 240, 176, 190, 223, 231, 171, 192, 223, 223, 165, 193, 223, 216, 160, 193, 223, 209, 154, 195, 223, 206, 153, 195, 223, 205, 151, 195, 223, 203, 150, 195, 223, 204, 150, 195, 223, 206, 153, 196, 223, 207, 152, 195, 223, 208, 153, 195, 223, 206, 153, 195, 223, 207, 152, 195, 223, 208, 153, 195, 223, 209, 154, 194, 223, 209, 155, 194, 223, 210, 156, 194, 223, 210, 156, 194, 223, 209, 154, 194, 223, 208, 153, 195, 223, 208, 153, 195, 223, 206, 152, 195, 223, 207, 152, 195, 223, 208, 153, 195, 223, 209, 154, 194, 223, 211, 156, 194, 223, 212, 156, 194, 223, 212, 156, 194, 223, 212, 156, 194, 223, 210, 156, 194, 223, 209, 155, 194, 223, 211, 156, 194, 223, 212, 155, 194, 223, 212, 156, 193, 223, 212, 156, 194, 223, 210, 156, 194, 223, 209, 154, 194, 223, 209, 154, 194, 223, 209, 153, 194, 223, 209, 154, 194, 223, 209, 155, 194, 223, 210, 156, 193, 223, 210, 156, 194, 223, 211, 156, 194, 223, 213, 157, 194, 223, 214, 157, 194, 223, 216, 159, 194, 223, 218, 159, 194, 223, 221, 161, 192, 223, 224, 164, 192, 223, 227, 168, 192, 223, 228, 168, 192, 223, 228, 168, 192, 223, 227, 168, 192, 223, 225, 165, 192, 223, 221, 163, 192, 223, 219, 161, 193, 223, 220, 162, 193, 223, 221, 162, 193, 223, 221, 163, 193, 223, 221, 163, 193, 223, 223, 163, 191, 223, 246, 186, 193, 223, 240, 180, 194, 223, 235, 176, 194, 223, 229, 173, 195, 223, 224, 168, 197, 223, 220, 165, 196, 223, 217, 163, 196, 223, 217, 163, 196, 223, 215, 162, 197, 223, 215, 162, 197, 223, 216, 163, 196, 223, 217, 163, 196, 223, 215, 162, 197, 223, 213, 160, 197, 223, 212, 159, 197, 223, 210, 158, 198, 223, 211, 158, 198, 223, 212, 160, 197, 223, 213, 160, 197, 223, 213, 160, 197, 223, 212, 160, 197, 223, 210, 158, 198, 223, 210, 158, 197, 223, 210, 158, 198, 223, 209, 157, 198, 223, 209, 158, 198, 223, 209, 158, 198, 223, 210, 158, 198, 223, 210, 158, 198, 223, 209, 158, 198, 223, 208, 156, 198, 223, 208, 156, 198, 223, 206, 155, 197, 223, 206, 155, 198, 223, 206, 155, 198, 223, 207, 155, 198, 223, 207, 155, 197, 223, 205, 154, 198, 223, 203, 152, 198, 223, 201, 151, 198, 223, 199, 150, 198, 223, 200, 150, 198, 223, 201, 151, 198, 223, 202, 151, 198, 223, 202, 151, 198, 223, 202, 152, 197, 223, 204, 153, 197, 223, 206, 154, 198, 223, 209, 157, 198, 223, 209, 158, 198, 223, 213, 159, 197, 223, 216, 162, 196, 223, 218, 163, 195, 223, 218, 163, 196, 223, 217, 162, 196, 223, 214, 161, 196, 223, 211, 158, 197, 223, 207, 154, 197, 223, 205, 153, 198, 223, 203, 152, 197, 223, 203, 152, 197, 223, 203, 152, 198, 223, 201, 150, 199, 223, 202, 152, 198, 223, 248, 190, 196, 223, 243, 186, 198, 223, 237, 182, 198, 223, 234, 178, 198, 223, 231, 177, 198, 223, 227, 174, 198, 223, 226, 172, 199, 223, 224, 171, 199, 223, 224, 171, 199, 223, 222, 171, 200, 223, 222, 171, 200, 223, 221, 168, 200, 223, 219, 168, 200, 223, 216, 166, 199, 223, 213, 164, 200, 223, 212, 161, 200, 223, 212, 162, 200, 223, 212, 162, 199, 223, 212, 161, 199, 223, 212, 162, 200, 223, 210, 161, 200, 223, 209, 159, 200, 223, 209, 160, 200, 223, 208, 159, 200, 223, 208, 159, 201, 223, 205, 157, 200, 223, 203, 156, 201, 223, 203, 155, 201, 223, 202, 154, 201, 223, 201, 154, 201, 223, 199, 152, 202, 223, 198, 152, 202, 223, 196, 150, 201, 223, 196, 149, 202, 223, 194, 148, 202, 223, 194, 147, 202, 223, 193, 147, 202, 223, 190, 146, 203, 223, 188, 144, 202, 223, 186, 142, 203, 223, 184, 141, 203, 223, 184, 141, 203, 223, 185, 141, 202, 223, 187, 143, 203, 223, 187, 143, 202, 223, 189, 144, 202, 223, 192, 146, 202, 223, 195, 149, 201, 223, 197, 150, 201, 223, 200, 152, 201, 223, 202, 155, 201, 223, 205, 156, 201, 223, 205, 156, 200, 223, 203, 155, 201, 223, 199, 153, 201, 223, 195, 149, 202, 223, 189, 145, 202, 223, 186, 142, 202, 223, 183, 139, 202, 223, 181, 139, 203, 223, 182, 139, 203, 223, 183, 139, 202, 223, 184, 140, 202, 223, 187, 142, 202, 223, 250, 196, 200, 223, 245, 192, 200, 223, 242, 189, 202, 223, 239, 187, 202, 223, 237, 185, 202, 223, 234, 184, 202, 223, 233, 181, 202, 223, 232, 181, 201, 223, 229, 178, 201, 223, 226, 176, 202, 223, 226, 177, 201, 223, 223, 173, 202, 223, 220, 172, 202, 223, 217, 170, 203, 223, 214, 167, 203, 223, 212, 166, 203, 223, 210, 164, 203, 223, 209, 163, 204, 223, 209, 163, 203, 223, 208, 161, 203, 223, 206, 160, 203, 223, 205, 159, 204, 223, 205, 159, 203, 223, 203, 158, 204, 223, 202, 157, 204, 223, 198, 154, 204, 223, 195, 151, 204, 223, 193, 149, 204, 223, 190, 149, 205, 223, 188, 146, 205, 223, 186, 144, 206, 223, 186, 144, 205, 223, 184, 143, 206, 223, 181, 140, 206, 223, 177, 137, 207, 223, 176, 137, 206, 223, 175, 135, 206, 223, 172, 134, 206, 223, 169, 131, 206, 223, 167, 129, 206, 223, 165, 128, 207, 223, 165, 128, 206, 223, 166, 129, 207, 223, 167, 130, 207, 223, 170, 132, 207, 223, 173, 135, 206, 223, 177, 138, 206, 223, 180, 140, 206, 223, 185, 143, 205, 223, 189, 146, 205, 223, 193, 150, 205, 223, 194, 151, 204, 223, 192, 149, 204, 223, 188, 146, 205, 223, 180, 140, 206, 223, 173, 135, 206, 223, 167, 129, 206, 223, 163, 126, 207, 223, 160, 123, 207, 223, 159, 123, 207, 223, 160, 124, 207, 223, 163, 126, 207, 223, 166, 129, 207, 223, 175, 136, 206, 223, 251, 201, 203, 223, 248, 198, 203, 223, 245, 195, 203, 223, 243, 194, 203, 223, 242, 192, 203, 223, 239, 190, 205, 223, 237, 189, 206, 223, 234, 186, 205, 223, 231, 183, 205, 223, 227, 181, 205, 223, 225, 178, 205, 223, 221, 176, 205, 223, 217, 172, 205, 223, 212, 168, 206, 223, 208, 165, 207, 223, 205, 162, 207, 223, 203, 161, 207, 223, 201, 159, 207, 223, 198, 157, 207, 223, 196, 155, 207, 223, 196, 155, 207, 223, 193, 152, 207, 223, 191, 151, 207, 223, 189, 149, 207, 223, 186, 146, 208, 223, 182, 144, 208, 223, 178, 140, 208, 223, 175, 138, 208, 223, 172, 136, 208, 223, 169, 133, 209, 223, 167, 132, 209, 223, 167, 131, 209, 223, 165, 130, 209, 223, 162, 127, 210, 223, 159, 125, 210, 223, 157, 124, 210, 223, 156, 123, 210, 223, 154, 121, 210, 223, 152, 119, 210, 223, 150, 118, 210, 223, 149, 117, 210, 223, 150, 118, 209, 223, 154, 121, 210, 223, 156, 123, 210, 223, 160, 126, 210, 223, 166, 131, 209, 223, 171, 134, 209, 223, 176, 138, 208, 223, 180, 142, 207, 223, 184, 145, 208, 223, 187, 148, 208, 223, 186, 146, 208, 223, 181, 143, 207, 223, 173, 137, 208, 223, 164, 130, 209, 223, 156, 122, 210, 223, 150, 118, 210, 223, 144, 113, 211, 223, 142, 111, 210, 223, 143, 113, 210, 223, 148, 116, 210, 223, 154, 121, 209, 223, 163, 128, 209, 223, 176, 139, 208, 223, 253, 205, 208, 223, 251, 206, 207, 223, 250, 203, 207, 223, 246, 201, 207, 223, 243, 197, 207, 223, 241, 195, 207, 223, 238, 194, 207, 223, 235, 190, 208, 223, 231, 187, 209, 223, 226, 183, 209, 223, 221, 178, 209, 223, 214, 173, 209, 223, 208, 168, 209, 223, 203, 164, 209, 223, 198, 160, 210, 223, 194, 156, 210, 223, 189, 153, 210, 223, 186, 150, 210, 223, 182, 146, 211, 223, 180, 145, 211, 223, 177, 143, 211, 223, 175, 140, 211, 223, 172, 138, 211, 223, 169, 136, 211, 223, 167, 134, 211, 223, 161, 129, 212, 223, 157, 125, 212, 223, 152, 121, 212, 223, 149, 119, 212, 223, 148, 118, 212, 223, 146, 116, 212, 223, 144, 115, 212, 223, 142, 113, 212, 223, 139, 111, 212, 223, 138, 109, 212, 223, 138, 109, 212, 223, 137, 109, 212, 223, 135, 107, 213, 223, 134, 106, 213, 223, 134, 106, 213, 223, 135, 107, 212, 223, 138, 110, 212, 223, 143, 114, 212, 223, 150, 119, 212, 223, 158, 126, 212, 223, 165, 133, 211, 223, 173, 138, 211, 223, 178, 143, 211, 223, 181, 145, 211, 223, 183, 146, 211, 223, 182, 146, 211, 223, 178, 144, 210, 223, 171, 137, 211, 223, 161, 129, 211, 223, 150, 120, 211, 223, 140, 112, 212, 223, 134, 107, 212, 223, 131, 104, 213, 223, 131, 104, 213, 223, 135, 107, 213, 223, 144, 114, 212, 223, 155, 124, 212, 223, 170, 137, 211, 223, 188, 150, 210, 223, 252, 209, 211, 223, 250, 206, 212, 223, 246, 204, 211, 223, 243, 200, 211, 223, 238, 196, 211, 223, 235, 194, 211, 223, 231, 191, 211, 223, 227, 187, 211, 223, 221, 182, 212, 223, 215, 177, 212, 223, 206, 170, 213, 223, 198, 162, 213, 223, 190, 156, 213, 223, 183, 150, 213, 223, 177, 145, 213, 223, 172, 140, 213, 223, 168, 137, 213, 223, 165, 134, 214, 223, 162, 132, 214, 223, 160, 130, 214, 223, 157, 128, 213, 223, 156, 126, 214, 223, 153, 124, 214, 223, 150, 122, 214, 223, 147, 119, 214, 223, 142, 114, 214, 223, 137, 111, 214, 223, 133, 108, 214, 223, 131, 106, 214, 223, 131, 105, 214, 223, 130, 104, 214, 223, 128, 103, 215, 223, 126, 101, 215, 223, 126, 100, 215, 223, 125, 100, 215, 223, 125, 100, 215, 223, 126, 101, 215, 223, 126, 101, 215, 223, 126, 101, 215, 223, 129, 103, 215, 223, 131, 106, 214, 223, 138, 111, 214, 223, 145, 117, 214, 223, 153, 123, 213, 223, 161, 131, 213, 223, 169, 137, 213, 223, 175, 142, 213, 223, 180, 147, 212, 223, 181, 148, 213, 223, 181, 148, 212, 223, 178, 145, 213, 223, 171, 140, 213, 223, 162, 131, 213, 223, 151, 122, 213, 223, 139, 112, 214, 223, 132, 106, 214, 223, 127, 101, 215, 223, 125, 101, 215, 223, 129, 103, 215, 223, 135, 109, 214, 223, 148, 120, 214, 223, 165, 134, 213, 223, 184, 149, 213, 223, 203, 165, 212, 223, 248, 209, 215, 223, 243, 204, 215, 223, 236, 199, 215, 223, 231, 195, 215, 223, 227, 191, 215, 223, 222, 186, 215, 223, 217, 181, 215, 223, 212, 177, 214, 223, 205, 171, 214, 223, 196, 163, 214, 223, 185, 155, 215, 223, 174, 144, 215, 223, 164, 136, 216, 223, 156, 128, 216, 223, 150, 123, 216, 223, 145, 119, 216, 223, 141, 115, 216, 223, 139, 114, 216, 223, 138, 113, 216, 223, 137, 112, 216, 223, 136, 111, 216, 223, 134, 110, 216, 223, 132, 108, 216, 223, 131, 107, 216, 223, 128, 105, 216, 223, 125, 101, 216, 223, 122, 99, 216, 223, 119, 97, 216, 223, 118, 95, 216, 223, 118, 96, 216, 223, 118, 96, 216, 223, 117, 95, 216, 223, 116, 94, 216, 223, 116, 94, 216, 223, 116, 95, 216, 223, 118, 96, 216, 223, 120, 98, 216, 223, 123, 100, 216, 223, 126, 103, 216, 223, 133, 109, 216, 223, 140, 115, 216, 223, 149, 123, 216, 223, 158, 130, 216, 223, 165, 136, 216, 223, 173, 143, 215, 223, 177, 146, 215, 223, 180, 149, 215, 223, 181, 149, 215, 223, 180, 149, 215, 223, 176, 147, 215, 223, 171, 142, 215, 223, 164, 135, 215, 223, 152, 126, 216, 223, 141, 116, 216, 223, 132, 107, 216, 223, 126, 102, 216, 223, 124, 101, 216, 223, 126, 103, 216, 223, 134, 110, 216, 223, 145, 119, 216, 223, 163, 135, 216, 223, 182, 151, 215, 223, 202, 168, 214, 223, 220, 184, 214, 223, 237, 203, 219, 223, 228, 193, 219, 223, 221, 188, 219, 223, 213, 181, 219, 223, 209, 178, 219, 223, 205, 174, 219, 223, 200, 170, 218, 223, 195, 165, 218, 223, 188, 158, 218, 223, 180, 152, 219, 223, 168, 141, 218, 223, 155, 130, 218, 223, 144, 120, 218, 223, 134, 112, 218, 223, 127, 105, 218, 223, 123, 102, 218, 223, 121, 99, 218, 223, 119, 98, 218, 223, 118, 97, 218, 223, 119, 98, 218, 223, 119, 98, 218, 223, 118, 97, 218, 223, 118, 97, 218, 223, 118, 97, 218, 223, 117, 96, 218, 223, 114, 94, 218, 223, 111, 91, 218, 223, 111, 90, 218, 223, 110, 90, 218, 223, 111, 90, 218, 223, 111, 91, 218, 223, 111, 90, 218, 223, 111, 91, 218, 223, 113, 92, 218, 223, 116, 95, 218, 223, 119, 98, 218, 223, 124, 102, 218, 223, 129, 106, 218, 223, 134, 111, 218, 223, 143, 119, 218, 223, 152, 127, 218, 223, 162, 136, 218, 223, 170, 143, 218, 223, 177, 150, 218, 223, 182, 153, 218, 223, 183, 155, 218, 223, 181, 153, 218, 223, 181, 152, 218, 223, 178, 150, 218, 223, 173, 145, 218, 223, 164, 138, 218, 223, 155, 130, 218, 223, 143, 119, 218, 223, 134, 111, 218, 223, 127, 104, 218, 223, 122, 101, 217, 223, 124, 102, 218, 223, 130, 108, 218, 223, 143, 119, 218, 223, 158, 132, 217, 223, 179, 151, 218, 223, 201, 169, 218, 223, 219, 185, 218, 223, 235, 200, 218, 223, 222, 193, 221, 223, 205, 177, 221, 223, 195, 168, 221, 223, 189, 162, 221, 223, 186, 160, 221, 223, 184, 158, 221, 223, 181, 156, 220, 223, 177, 151, 221, 223, 173, 148, 220, 223, 166, 143, 220, 223, 154, 131, 220, 223, 141, 119, 219, 223, 129, 108, 220, 223, 118, 98, 219, 223, 111, 92, 219, 223, 109, 90, 219, 223, 106, 87, 219, 223, 104, 86, 219, 223, 104, 86, 219, 223, 105, 86, 219, 223, 106, 87, 219, 223, 106, 88, 219, 223, 108, 89, 219, 223, 109, 90, 219, 223, 110, 91, 219, 223, 111, 92, 219, 223, 111, 92, 219, 223, 110, 91, 219, 223, 109, 90, 219, 223, 108, 89, 219, 223, 108, 89, 219, 223, 110, 91, 219, 223, 113, 94, 219, 223, 118, 98, 219, 223, 123, 103, 219, 223, 130, 109, 219, 223, 136, 115, 219, 223, 143, 121, 219, 223, 151, 127, 220, 223, 159, 135, 220, 223, 168, 143, 220, 223, 177, 151, 220, 223, 184, 158, 219, 223, 187, 161, 220, 223, 189, 163, 220, 223, 188, 161, 220, 223, 184, 157, 219, 223, 180, 154, 220, 223, 174, 149, 219, 223, 166, 141, 219, 223, 157, 133, 220, 223, 146, 123, 219, 223, 134, 112, 219, 223, 125, 104, 219, 223, 120, 100, 219, 223, 120, 100, 218, 223, 127, 106, 219, 223, 137, 116, 219, 223, 154, 130, 219, 223, 174, 149, 220, 223, 197, 170, 220, 223, 220, 189, 221, 223, 234, 202, 221, 223, 246, 213, 221, 223, 204, 179, 224, 223, 183, 160, 223, 223, 175, 152, 223, 223, 169, 147, 222, 223, 169, 147, 222, 223, 169, 147, 222, 223, 167, 145, 222, 223, 166, 144, 222, 223, 163, 141, 222, 223, 157, 135, 221, 223, 146, 125, 221, 223, 131, 112, 221, 223, 118, 99, 220, 223, 106, 89, 220, 223, 100, 83, 219, 223, 98, 81, 219, 223, 96, 79, 219, 223, 95, 78, 219, 223, 95, 78, 219, 223, 96, 79, 219, 223, 97, 81, 219, 223, 99, 82, 219, 223, 101, 84, 220, 223, 103, 86, 220, 223, 105, 88, 220, 223, 108, 90, 220, 223, 109, 91, 219, 223, 109, 91, 220, 223, 109, 91, 220, 223, 109, 91, 220, 223, 110, 92, 220, 223, 114, 96, 220, 223, 120, 101, 220, 223, 128, 109, 221, 223, 136, 116, 221, 223, 145, 124, 221, 223, 153, 131, 221, 223, 162, 139, 222, 223, 170, 148, 222, 223, 178, 155, 222, 223, 185, 161, 223, 223, 190, 167, 224, 223, 194, 169, 223, 223, 196, 170, 223, 223, 193, 169, 224, 223, 189, 165, 223, 223, 183, 160, 222, 223, 177, 154, 223, 223, 169, 145, 222, 223, 159, 136, 221, 223, 147, 127, 221, 223, 136, 116, 220, 223, 124, 105, 220, 223, 118, 99, 220, 223, 115, 97, 220, 223, 118, 100, 220, 223, 130, 111, 220, 223, 144, 124, 221, 223, 165, 142, 221, 223, 188, 165, 223, 223, 213, 186, 224, 223, 235, 207, 225, 223, 246, 217, 225, 223, 252, 223, 226, 223, 186, 164, 226, 223, 161, 141, 224, 223, 157, 137, 224, 223, 158, 138, 224, 223, 160, 141, 224, 223, 163, 143, 224, 223, 165, 145, 224, 223, 164, 144, 225, 223, 160, 140, 224, 223, 153, 134, 223, 223, 141, 121, 222, 223, 126, 109, 222, 223, 112, 95, 221, 223, 100, 85, 220, 223, 95, 79, 220, 223, 93, 77, 220, 223, 92, 76, 220, 223, 91, 75, 220, 223, 92, 76, 220, 223, 93, 78, 220, 223, 95, 80, 220, 223, 97, 81, 220, 223, 99, 83, 220, 223, 101, 85, 220, 223, 104, 87, 221, 223, 107, 91, 221, 223, 109, 92, 221, 223, 110, 93, 221, 223, 110, 93, 221, 223, 113, 96, 221, 223, 118, 100, 221, 223, 126, 108, 222, 223, 137, 118, 222, 223, 149, 129, 223, 223, 160, 141, 224, 223, 170, 149, 225, 223, 178, 157, 225, 223, 185, 164, 225, 223, 190, 168, 225, 223, 195, 173, 225, 223, 199, 176, 226, 223, 199, 178, 226, 223, 198, 176, 226, 223, 196, 174, 226, 223, 192, 170, 225, 223, 185, 165, 225, 223, 178, 157, 224, 223, 169, 148, 224, 223, 159, 139, 224, 223, 147, 128, 223, 223, 136, 118, 222, 223, 125, 108, 221, 223, 117, 100, 221, 223, 111, 95, 221, 223, 111, 94, 221, 223, 117, 100, 221, 223, 132, 114, 223, 223, 152, 132, 223, 223, 175, 154, 225, 223, 200, 178, 226, 223, 225, 201, 228, 223, 245, 219, 229, 223, 251, 225, 229, 223, 254, 229, 229, 223, 175, 157, 228, 223, 150, 132, 226, 223, 149, 132, 225, 223, 153, 135, 225, 223, 158, 140, 226, 223, 163, 145, 226, 223, 166, 149, 227, 223, 165, 148, 227, 223, 161, 143, 226, 223, 151, 133, 226, 223, 137, 121, 224, 223, 122, 107, 223, 223, 108, 92, 222, 223, 96, 82, 221, 223, 91, 77, 220, 223, 90, 75, 221, 223, 89, 74, 220, 223, 90, 75, 220, 223, 90, 76, 221, 223, 93, 77, 220, 223, 94, 79, 221, 223, 96, 81, 221, 223, 98, 83, 221, 223, 100, 84, 221, 223, 104, 89, 222, 223, 109, 93, 222, 223, 112, 96, 223, 223, 114, 98, 222, 223, 116, 100, 223, 223, 122, 106, 223, 223, 130, 113, 223, 223, 142, 125, 225, 223, 156, 138, 225, 223, 170, 152, 227, 223, 184, 165, 227, 223, 193, 173, 229, 223, 200, 181, 229, 223, 206, 186, 229, 223, 209, 189, 229, 223, 210, 191, 229, 223, 210, 190, 229, 223, 206, 186, 229, 223, 201, 182, 229, 223, 195, 175, 228, 223, 187, 168, 228, 223, 179, 160, 227, 223, 171, 153, 226, 223, 160, 142, 226, 223, 147, 130, 225, 223, 136, 120, 224, 223, 125, 109, 223, 223, 117, 101, 222, 223, 110, 95, 222, 223, 107, 91, 221, 223, 108, 92, 222, 223, 116, 100, 223, 223, 135, 117, 224, 223, 158, 140, 225, 223, 184, 165, 227, 223, 210, 190, 230, 223, 235, 213, 232, 223, 252, 230, 233, 223, 255, 233, 233, 223, 255, 233, 233, 223, 179, 163, 230, 223, 155, 139, 227, 223, 158, 142, 228, 223, 165, 150, 228, 223, 170, 154, 228, 223, 174, 158, 229, 223, 175, 159, 230, 223, 173, 158, 229, 223, 164, 149, 228, 223, 153, 137, 227, 223, 136, 121, 226, 223, 121, 106, 224, 223, 107, 93, 223, 223, 96, 82, 221, 223, 91, 77, 221, 223, 90, 76, 221, 223, 90, 76, 222, 223, 91, 77, 221, 223, 92, 78, 221, 223, 93, 79, 222, 223, 94, 80, 221, 223, 95, 81, 222, 223, 97, 83, 222, 223, 100, 85, 222, 223, 104, 90, 223, 223, 112, 98, 223, 223, 119, 104, 224, 223, 124, 109, 224, 223, 130, 116, 225, 223, 140, 125, 226, 223, 152, 137, 227, 223, 165, 149, 228, 223, 178, 162, 229, 223, 191, 175, 231, 223, 202, 185, 232, 223, 208, 192, 233, 223, 214, 197, 233, 223, 218, 201, 233, 223, 220, 203, 233, 223, 217, 200, 233, 223, 213, 197, 233, 223, 208, 191, 232, 223, 199, 182, 232, 223, 188, 172, 230, 223, 178, 162, 230, 223, 168, 152, 229, 223, 158, 142, 227, 223, 146, 130, 226, 223, 134, 119, 226, 223, 124, 109, 224, 223, 117, 103, 223, 223, 110, 96, 223, 223, 106, 92, 222, 223, 104, 90, 222, 223, 106, 92, 223, 223, 115, 100, 223, 223, 136, 121, 226, 223, 161, 145, 228, 223, 187, 171, 230, 223, 215, 197, 233, 223, 237, 219, 236, 223, 253, 235, 237, 223, 255, 237, 237, 223, 255, 237, 237, 223, 186, 172, 234, 223, 163, 150, 231, 223, 168, 155, 231, 223, 178, 164, 233, 223, 184, 170, 233, 223, 187, 173, 233, 223, 187, 174, 233, 223, 183, 170, 233, 223, 172, 158, 232, 223, 155, 142, 230, 223, 138, 125, 227, 223, 121, 107, 226, 223, 106, 93, 224, 223, 96, 83, 222, 223, 91, 78, 222, 223, 91, 78, 222, 223, 92, 79, 222, 223, 93, 79, 222, 223, 93, 80, 222, 223, 95, 82, 222, 223, 96, 82, 223, 223, 97, 84, 223, 223, 100, 86, 223, 223, 104, 90, 224, 223, 110, 97, 224, 223, 121, 107, 226, 223, 130, 117, 226, 223, 138, 125, 227, 223, 148, 134, 229, 223, 162, 148, 230, 223, 177, 164, 232, 223, 189, 175, 233, 223, 202, 188, 235, 223, 213, 199, 236, 223, 222, 208, 236, 223, 225, 211, 237, 223, 229, 215, 238, 223, 231, 217, 239, 223, 231, 217, 238, 223, 226, 211, 238, 223, 220, 206, 237, 223, 208, 193, 236, 223, 197, 183, 233, 223, 182, 169, 233, 223, 168, 155, 231, 223, 156, 143, 230, 223, 145, 131, 228, 223, 133, 119, 226, 223, 123, 109, 226, 223, 115, 102, 225, 223, 110, 96, 224, 223, 107, 94, 223, 223, 105, 91, 223, 223, 104, 90, 223, 223, 107, 94, 224, 223, 118, 104, 225, 223, 139, 125, 228, 223, 165, 150, 231, 223, 191, 177, 234, 223, 217, 204, 236, 223, 240, 225, 239, 223, 253, 239, 240, 223, 255, 240, 241, 223, 255, 241, 241, 223, 201, 190, 237, 223, 183, 172, 236, 223, 185, 175, 236, 223, 193, 182, 237, 223, 197, 187, 237, 223, 200, 189, 238, 223, 199, 189, 238, 223, 194, 184, 237, 223, 182, 171, 235, 223, 165, 154, 233, 223, 145, 133, 230, 223, 125, 113, 227, 223, 108, 97, 225, 223, 96, 84, 223, 223, 92, 79, 223, 223, 92, 80, 223, 223, 93, 80, 223, 223, 94, 82, 223, 223, 96, 83, 224, 223, 98, 85, 223, 223, 101, 89, 224, 223, 106, 94, 225, 223, 113, 100, 226, 223, 120, 108, 227, 223, 129, 117, 228, 223, 142, 131, 230, 223, 154, 142, 231, 223, 164, 152, 232, 223, 175, 163, 233, 223, 188, 176, 236, 223, 199, 188, 237, 223, 208, 198, 239, 223, 218, 207, 239, 223, 225, 214, 241, 223, 232, 221, 241, 223, 235, 224, 243, 223, 238, 228, 242, 223, 239, 228, 242, 223, 237, 226, 242, 223, 229, 218, 242, 223, 220, 209, 239, 223, 207, 196, 238, 223, 191, 179, 236, 223, 175, 164, 234, 223, 160, 149, 231, 223, 146, 134, 230, 223, 133, 121, 228, 223, 124, 111, 227, 223, 117, 105, 226, 223, 112, 100, 225, 223, 110, 98, 225, 223, 109, 96, 225, 223, 108, 96, 225, 223, 110, 98, 225, 223, 116, 103, 226, 223, 127, 115, 227, 223, 147, 136, 230, 223, 170, 158, 233, 223, 196, 184, 237, 223, 220, 209, 239, 223, 240, 229, 242, 223, 252, 241, 244, 223, 251, 240, 244, 223, 251, 240, 244, 223, 217, 208, 242, 223, 203, 195, 241, 223, 204, 196, 241, 223, 209, 202, 241, 223, 211, 204, 242, 223, 213, 206, 242, 223, 212, 205, 242, 223, 207, 199, 242, 223, 193, 184, 239, 223, 174, 165, 236, 223, 151, 142, 233, 223, 129, 118, 229, 223, 111, 100, 226, 223, 98, 87, 225, 223, 93, 82, 224, 223, 93, 82, 224, 223, 95, 83, 224, 223, 97, 86, 224, 223, 100, 88, 225, 223, 104, 93, 226, 223, 110, 99, 226, 223, 119, 108, 228, 223, 129, 119, 229, 223, 141, 131, 231, 223, 153, 144, 233, 223, 167, 157, 235, 223, 179, 170, 237, 223, 191, 182, 238, 223, 202, 194, 240, 223, 212, 204, 243, 223, 220, 212, 243, 223, 226, 219, 245, 223, 232, 224, 244, 223, 237, 231, 245, 223, 242, 236, 246, 223, 246, 239, 246, 223, 247, 240, 246, 223, 247, 240, 246, 223, 245, 237, 247, 223, 234, 227, 246, 223, 221, 213, 243, 223, 203, 195, 241, 223, 186, 177, 238, 223, 167, 158, 235, 223, 151, 141, 232, 223, 137, 126, 230, 223, 124, 114, 229, 223, 118, 106, 228, 223, 113, 102, 227, 223, 112, 101, 226, 223, 113, 101, 226, 223, 114, 102, 227, 223, 115, 104, 227, 223, 119, 108, 227, 223, 127, 116, 229, 223, 139, 129, 231, 223, 158, 148, 233, 223, 179, 170, 236, 223, 202, 193, 240, 223, 221, 214, 243, 223, 240, 232, 245, 223, 251, 244, 248, 223, 250, 243, 247, 223, 248, 241, 247, 223, 227, 223, 248, 223, 217, 213, 246, 223, 218, 214, 246, 223, 222, 217, 247, 223, 225, 221, 247, 223, 227, 224, 248, 223, 226, 223, 247, 223, 219, 215, 246, 223, 202, 196, 243, 223, 180, 173, 239, 223, 155, 147, 235, 223, 131, 122, 231, 223, 112, 103, 228, 223, 100, 89, 226, 223, 97, 86, 225, 223, 98, 88, 225, 223, 102, 92, 226, 223, 108, 98, 227, 223, 115, 106, 228, 223, 125, 116, 230, 223, 136, 127, 232, 223, 147, 139, 234, 223, 159, 151, 236, 223, 170, 163, 237, 223, 180, 174, 239, 223, 191, 186, 242, 223, 201, 196, 243, 223, 211, 205, 245, 223, 218, 214, 246, 223, 224, 220, 247, 223, 231, 227, 248, 223, 235, 232, 248, 223, 240, 236, 250, 223, 245, 241, 250, 223, 249, 245, 251, 223, 251, 246, 252, 223, 251, 247, 252, 223, 249, 246, 250, 223, 244, 240, 250, 223, 231, 228, 248, 223, 216, 210, 245, 223, 196, 191, 242, 223, 176, 170, 239, 223, 158, 150, 236, 223, 143, 135, 233, 223, 133, 124, 231, 223, 127, 117, 230, 223, 125, 115, 230, 223, 125, 116, 230, 223, 127, 118, 231, 223, 130, 120, 231, 223, 132, 123, 231, 223, 135, 126, 232, 223, 140, 131, 233, 223, 148, 139, 234, 223, 158, 150, 236, 223, 174, 166, 238, 223, 189, 184, 241, 223, 209, 204, 245, 223, 227, 221, 247, 223, 240, 236, 249, 223, 250, 246, 250, 223, 251, 245, 252, 223, 251, 247, 251, 223, 237, 237, 252, 223, 232, 230, 251, 223, 232, 231, 251, 223, 234, 233, 251, 223, 238, 236, 252, 223, 241, 240, 253, 223, 240, 239, 253, 223, 232, 230, 250, 223, 212, 210, 247, 223, 186, 182, 242, 223, 158, 152, 238, 223, 133, 126, 232, 223, 116, 107, 230, 223, 104, 94, 227, 223, 102, 92, 227, 223, 105, 96, 227, 223, 113, 104, 229, 223, 122, 114, 230, 223, 135, 128, 233, 223, 149, 142, 235, 223, 163, 158, 238, 223, 178, 174, 241, 223, 191, 187, 243, 223, 201, 198, 245, 223, 211, 208, 247, 223, 217, 215, 248, 223, 223, 221, 249, 223, 231, 229, 251, 223, 236, 235, 251, 223, 238, 237, 252, 223, 242, 240, 253, 223, 244, 244, 253, 223, 248, 248, 253, 223, 251, 250, 255, 223, 254, 254, 255, 223, 255, 255, 255, 223, 254, 254, 255, 223, 250, 250, 254, 223, 243, 242, 253, 223, 229, 228, 250, 223, 210, 208, 247, 223, 189, 184, 242, 223, 167, 161, 239, 223, 150, 143, 236, 223, 137, 130, 234, 223, 132, 124, 232, 223, 131, 123, 232, 223, 134, 126, 233, 223, 139, 132, 233, 223, 144, 138, 235, 223, 149, 143, 236, 223, 154, 147, 236, 223, 157, 150, 237, 223, 162, 156, 238, 223, 170, 164, 240, 223, 179, 175, 241, 223, 191, 186, 243, 223, 204, 201, 246, 223, 219, 217, 248, 223, 232, 231, 251, 223, 242, 242, 253, 223, 249, 248, 254, 223, 251, 250, 255, 223, 253, 253, 255, 223, 245, 245, 253, 223, 242, 240, 253, 223, 242, 240, 253, 223, 243, 242, 253, 223, 246, 246, 253, 223, 248, 248, 253, 223, 244, 244, 253, 223, 236, 235, 252, 223, 213, 211, 247, 223, 188, 184, 243, 223, 163, 158, 238, 223, 143, 136, 234, 223, 131, 123, 232, 223, 126, 118, 231, 223, 127, 119, 232, 223, 133, 125, 233, 223, 142, 134, 234, 223, 153, 147, 237, 223, 164, 159, 238, 223, 177, 172, 241, 223, 191, 186, 243, 223, 202, 198, 245, 223, 212, 210, 247, 223, 220, 218, 249, 223, 226, 224, 249, 223, 231, 229, 251, 223, 235, 234, 251, 223, 240, 239, 252, 223, 244, 243, 253, 223, 246, 246, 253, 223, 248, 248, 253, 223, 250, 249, 254, 223, 251, 250, 255, 223, 254, 254, 255, 223, 255, 255, 255, 223, 255, 255, 255, 223, 253, 253, 255, 223, 248, 247, 254, 223, 238, 236, 252, 223, 221, 219, 249, 223, 202, 198, 245, 223, 180, 175, 242, 223, 161, 155, 238, 223, 151, 144, 236, 223, 145, 138, 235, 223, 146, 139, 235, 223, 148, 141, 236, 223, 153, 147, 236, 223, 160, 155, 237, 223, 166, 161, 239, 223, 173, 167, 240, 223, 177, 171, 241, 223, 180, 176, 242, 223, 185, 181, 242, 223, 193, 189, 243, 223, 203, 199, 245, 223, 213, 210, 247, 223, 223, 221, 249, 223, 233, 232, 251, 223, 241, 241, 253, 223, 247, 247, 253, 223, 251, 250, 255, 223, 254, 254, 255, 223, 255, 255, 255, 223, 253, 253, 255, 223, 251, 251, 255, 223, 251, 251, 255, 223, 251, 251, 255, 223, 252, 252, 255, 223, 252, 252, 255, 223, 249, 248, 254, 223, 238, 237, 252, 223, 215, 212, 247, 223, 191, 187, 244, 223, 169, 164, 239, 223, 154, 147, 237, 223, 149, 143, 236, 223, 151, 144, 236, 223, 156, 150, 237, 223, 165, 160, 238, 223, 176, 171, 240, 223, 187, 183, 243, 223, 198, 194, 245, 223, 208, 206, 247, 223, 218, 216, 248, 223, 227, 225, 250, 223, 233, 233, 251, 223, 239, 237, 252, 223, 242, 241, 253, 223, 246, 246, 253, 223, 248, 248, 253, 223, 251, 250, 255, 223, 253, 253, 255, 223, 253, 253, 255, 223, 253, 253, 255, 223, 254, 254, 255, 223, 255, 255, 255, 223, 255, 255, 255, 223, 255, 255, 255, 223, 255, 255, 255, 223, 252, 251, 255, 223, 244, 243, 253, 223, 232, 230, 250, 223, 213, 210, 247, 223, 192, 188, 244, 223, 171, 166, 239, 223, 156, 150, 237, 223, 152, 146, 236, 223, 155, 149, 237, 223, 160, 155, 237, 223, 168, 162, 239, 223, 175, 170, 240, 223, 183, 178, 242, 223, 190, 186, 243, 223, 197, 194, 244, 223, 202, 199, 245, 223, 206, 203, 246, 223, 211, 208, 247, 223, 218, 216, 248, 223, 225, 223, 249, 223, 233, 232, 251, 223, 240, 239, 252, 223, 246, 246, 253, 223, 251, 250, 255, 223, 252, 252, 255, 223, 254, 254, 255, 223, 255, 255, 255, 223, 255, 255, 255, 223, 255, 255, 255, 223, 253, 253, 255, 223, 253, 253, 255, 223, 253, 253, 255, 223, 254, 254, 255, 223, 254, 254, 255, 223, 250, 250, 254, 223, 241, 241, 252, 223, 223, 221, 249, 223, 203, 200, 245, 223, 188, 185, 243, 223, 178, 173, 241, 223, 176, 171, 241, 223, 180, 174, 241, 223, 185, 180, 242, 223, 191, 187, 243, 223, 200, 197, 245, 223, 209, 206, 247, 223, 218, 216, 248, 223, 224, 222, 249, 223, 231, 229, 251, 223, 237, 235, 252, 223, 242, 241, 253, 223, 246, 246, 253, 223, 250, 249, 254, 223, 251, 249, 255, 223, 251, 250, 255, 223, 254, 254, 255, 223, 255, 255, 255, 223, 255, 255, 255, 223, 255, 255, 255, 223, 255, 255, 255, 223, 255, 255, 255, 223, 252, 252, 255, 223, 250, 249, 254, 223, 246, 246, 253, 223, 241, 240, 252, 223, 230, 229, 250, 223, 217, 215, 248, 223, 201, 198, 245, 223, 188, 185, 243, 223, 177, 172, 241, 223, 169, 164, 239, 223, 170, 165, 239, 223, 175, 170, 240, 223, 183, 178, 242, 223, 191, 187, 243, 223, 200, 196, 245, 223, 207, 203, 246, 223, 213, 210, 247, 223, 218, 216, 249, 223, 223, 220, 249, 223, 226, 224, 249, 223, 230, 228, 251, 223, 233, 233, 251, 223, 239, 237, 252, 223, 243, 242, 253, 223, 247, 247, 253, 223, 251, 250, 255, 223, 253, 253, 255, 223, 254, 254, 255, 223, 255, 255, 255, 223, 255, 255, 255, 223, 255, 255, 255, 223, 255, 255, 255, 223, 255, 255, 255, 223, 255, 255, 255, 223, 255, 255, 255, 223, 255, 255, 255, 223, 254, 254, 255, 223, 251, 250, 255, 223, 245, 244, 253, 223, 231, 229, 250, 223, 217, 215, 248, 223, 209, 206, 246, 223, 206, 203, 246, 223, 208, 205, 247, 223, 211, 209, 247, 223, 216, 213, 247, 223, 220, 218, 249, 223, 226, 224, 249, 223, 232, 231, 251, 223, 239, 237, 252, 223, 242, 241, 253, 223, 246, 246, 253, 223, 250, 249, 254, 223, 252, 252, 255, 223, 253, 253, 255, 223, 253, 253, 255, 223, 254, 254, 255, 223, 255, 255, 255, 223, 255, 255, 255, 223, 255, 255, 255, 223, 255, 255, 255, 223, 255, 255, 255, 223, 255, 255, 255, 223, 254, 254, 255, 223, 250, 250, 254, 223, 245, 245, 253, 223, 238, 238, 252, 223, 230, 229, 250, 223, 215, 213, 248, 223, 202, 199, 245, 223, 191, 188, 243, 223, 184, 179, 242, 223, 181, 177, 242, 223, 184, 179, 242, 223, 190, 186, 243, 223, 199, 195, 245, 223, 207, 205, 247, 223, 216, 214, 248, 223, 223, 221, 249, 223, 231, 229, 251, 223, 237, 235, 252, 223, 241, 241, 253, 223, 244, 244, 253, 223, 246, 246, 253, 223, 248, 248, 253, 223, 251, 250, 255, 223, 252, 252, 255, 223, 254, 254, 255, 223, 255, 255, 255, 223, 255, 255, 255, 223, 255, 255, 255, 223, 255, 255, 255, 223, 255, 255, 255, 223, 255, 255, 255, 223, 0, 0, 0, 223
};

static const unsigned int cnt=16384;


DECLARE_SOBJ_INHERITANCE(sad::Texture, sad::resource::Resource);

sad::Texture::Texture() 
: m_renderer(NULL), Bpp(32), Width(0), Height(0), Id(0), OnGPU(false)
{

}

sad::Texture::~Texture()
{
	if (this->renderer())
	{
		if (this->renderer()->context()->valid())
		{
			if (this->renderer()->isOwnThread())
			{
				this->unload();
			}
			else
			{
				if (this->renderer()->running())
				{
					this->renderer()->pipeline()->append(new  sad::util::DeleteTextureTask(Id));
				}
			}
		}
	}
}

void sad::Texture::upload()
{
	// We must not upload on our own to not cause
	// undefined behaviour
	sad::Renderer * r = renderer();
	if (!r || Width == 0 || Height == 0)
		return;

	OnGPU = true;
	
	// Get texture type and components
	GLuint type = GL_RGBA, components = 4;
	if (Bpp == 24)
	{
		 type = GL_RGB;  
		 components = 3;
	}

	if ((Width & (Width - 1)) != 0 || (Height & (Height - 1)) !=0 || Width != Height)
	{
		if (r->opengl()->supportsExtension("GL_ARB_texture_rectangle") == false
			|| r->opengl()->supportsExtension("GL_ARB_texture_non_power_of_two") == false)
		{
			convertToPOTTexture();
		}
	}
	// Create ID of texture and bind it
    glGenTextures(1, (GLuint *)&Id);
	glBindTexture(GL_TEXTURE_2D, Id);

    glPixelStorei(GL_UNPACK_ALIGNMENT,1);	
	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);

	glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
	glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST_MIPMAP_NEAREST);	


	// Build Mip Maps	
	GLint res;
	unsigned char const * errorstring;
	sad::Pair<int,int> version = r->opengl()->version();
	if (version.p1() < 3) // In OpenGL 3.0  glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP, GL_TRUE);  is deprecated
	{
		if (version.p1() == 1 && version.p2() < 4)
		{
			res=gluBuild2DMipmaps(GL_TEXTURE_2D, components, Width, Height, type, GL_UNSIGNED_BYTE, Data.data());
		}
		else
		{
			  glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP, GL_TRUE); 
			  glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, Width, Height, 0, type, GL_UNSIGNED_BYTE, Data.data());
			  res = glGetError();
			  errorstring = gluErrorString(res);
		}
	} 
	else
	{
		float max  = (float)((Width > Height) ? Width : Height);
		int levels = (int)(::log(max)/::log(2.0f));
		glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8,  Width, Height, 0, type, GL_UNSIGNED_BYTE, Data.data());			  
		res = glGetError();
		sad::os::generateMipMaps30(r, GL_TEXTURE_2D);		
		res = glGetError();
	}
	if (res)
	{
		SL_COND_LOCAL_INTERNAL(gluErrorString(res), r);
	}
}

void sad::Texture::loadDefaultTexture()
{
	Bpp = 32;
	Width = 64;
	Height = 64;
	for (unsigned int i = 0; i < cnt; i++) 
		Data << texdata[i]; 
}

void sad::Texture::unloadFromGPU()
{
	this->unload();
}

bool sad::Texture::load(
		const sad::resource::PhysicalFile & file,
		sad::Renderer * r,
		const picojson::value& options
)
{
	bool result = load(file.name(), r);
	if (!result && !util::isAbsolutePath(file.name()))
	{
		sad::String newpath = util::concatPaths(r->executablePath(), file.name());
		result = load(newpath, r);
	}
	if (result)
	{
		sad::Maybe<sad::Color> maybecolor = picojson::to_type<sad::Color>(
			picojson::get_property(options, "transparent")
		);		
		if (maybecolor.exists())
		{
			this->setAlpha(255, maybecolor.value());
		}
	}
	return result;
}

bool sad::Texture::load(const sad::String & filename, sad::Renderer * r)
{
	if (!r)
	{
		r = sad::Renderer::ref();
	}
	m_renderer = r;
	sad::String ff(filename.getExtension());
	char * f=const_cast<char *>(ff.data());
	while(*f) { *f=toupper(*f); ++f; }

	sad::imageformats::Loader * l = r->textureLoader(ff);
	if (l)
	{
		FILE * fl = fopen(filename.data(), "rb");
		if (fl)
		{
			bool result = l->load(fl, this);
			fclose(fl);
			return result;
		}
	}
	return false;
}

bool sad::Texture::load(const sad::WString & filename, sad::Renderer * r)
{
	if (!r)
	{
		r = sad::Renderer::ref();
	}
	m_renderer = r;
	char * tmp=new char[2*filename.length()+2];
	wcstombs(tmp,filename.data(),2*filename.length()+2);
	sad::String tt(tmp);
	delete tmp;
	return load(tt, r);
}

void sad::Texture::bind()
{
	if (!OnGPU)
		upload();
	glBindTexture(GL_TEXTURE_2D, Id);
}

void sad::Texture::unload()
{
	if (OnGPU)
		glDeleteTextures(1, &Id);
	OnGPU = false;
}


void sad::Texture::setAlpha(sad::uchar a)
{
	assert(Bpp == 32);
	for (unsigned int i = 3 ; i < Data.count(); i += 4)
	{
		Data[i] = 255 - a;
	}
}

void sad::Texture::setAlpha(sad::uchar a, const sad::Color & clr)
{
	assert(Bpp == 32);
	for (unsigned int i = 0 ; i < Data.count(); i += 4)
	{
		bool matches = Data[i  ] == clr.r()
			        && Data[i+1] == clr.g()
					&& Data[i+2] == clr.b();
		if (matches)
		{
			Data[i + 3] = 255 - a;
		}
	}
}

void sad::Texture::setAlpha(sad::uchar a, const sad::Color & clr,const sad::Rect2D & rect)
{
	sad::Rect2I tmp = sad::_(rect);
	for (int i=0;i<4;i++)
	{
		if (tmp[i].x() < 0) tmp[i].setX(0);
		if (tmp[i].y() < 0) tmp[i].setY(0);
		if (tmp[i].x() > (int)(width()-1)) tmp[i].setX(this->width()-1);
		if (tmp[i].y() > (int)(height()-1)) tmp[i].setY(this->height()-1);
	}
	int minx = (int)tmp[0].x();
	int maxx = (int)tmp[2].x();
	int miny = (int)tmp[0].y();
	int maxy = (int)tmp[2].y();
	if (maxx < minx)
	{
		std::swap(maxx, minx);
	}
	if (maxy < miny)
	{
		std::swap(maxy, miny);
	}
	for (int row = minx;row <= maxx; row++)
	{
		for (int col = miny;col <= maxy; col++)
		{
			sad::uchar * pix=this->pixel(row,col);
            bool redmatches   = clr.r() == pix[0];
            bool greenmatches = clr.g() == pix[1];
            bool bluematches  = clr.b() == pix[2];
			if (redmatches && greenmatches && bluematches)
			{
				setPixelAlpha(row, col, a);
			}
		}
	}
}


sad::Renderer * sad::Texture::renderer() const
{
	return m_renderer;
}

void sad::Texture::convertToPOTTexture()
{
	unsigned int  maxside = std::max(Width, Height);
	unsigned int  size = 1;
	while(size < maxside)
	{
		size =  size << 1;
	}
	// Copy old buffer
	sad::Vector<sad::uchar> OldBuffer = Data;
	
	// Resize buffer and fill it with zero
	Data.rescale(size * size * Bpp / 8);	
	std::fill_n(Data.begin(), size * size * Bpp / 8, 0);

	// Copy data from old buffer
	for(unsigned int x = 0; x < Height; x++)
	{
		std::copy(OldBuffer.begin() + (Width * (Bpp / 8) * x), 
				  OldBuffer.begin() + (Width * (Bpp / 8) * (x+1)),
				  Data.begin() + (size * (Bpp / 8) * x)
				 );
	}
	Width = size;
	Height = size;
}
